diff --git a/SConstruct b/SConstruct
index 08d2cb61f23ee6384aec776c77c24eca237e65e3..aaeced7881a446e7a87816216c30085a682a8fa8 100644
--- a/SConstruct
+++ b/SConstruct
@@ -37,7 +37,7 @@ else:
 	STARS_CCFLAGS=" -O3"
 
 if int(argenv['do_64bit_analysis']) == 1:
-	STARS_CCFLAGS+=" -DEA64"
+	STARS_CCFLAGS+=" -D__EA64__"
 
 
 Export('argenv', 'STARS_CCFLAGS')
diff --git a/src/drivers/idapro/SMPStaticAnalyzer.cpp b/src/drivers/idapro/SMPStaticAnalyzer.cpp
index 373062841ced1c58465747a5f3a130b163bb4ebb..633624cf6b0505c41d6eebd159c95edb0fbd30dd 100644
--- a/src/drivers/idapro/SMPStaticAnalyzer.cpp
+++ b/src/drivers/idapro/SMPStaticAnalyzer.cpp
@@ -43,6 +43,8 @@
 #include <ida.hpp>
 #include <ua.hpp>
 #include <bytes.hpp>
+#include <loader.hpp>
+#include <nalt.hpp>
 
 #include "interfaces/STARSTypes.h"
 #include "interfaces/STARSIDATypes.h"
@@ -287,19 +289,6 @@ int IDAP_init(void) {
 		error("Processor must be x86.");
  		return PLUGIN_SKIP;
 	}
-#if 0 // too early to detect 64-bit; moved to IDAP_run()
-	if (inf.is_64bit()) {
-		STARS_ISA_Bitwidth = 64;
-		STARS_ISA_dtyp = dt_qword;
-		SMP_msg("INFO: 64-bit binary detected.\n");
-	}
-	else {
-		STARS_ISA_Bitwidth = 32;
-		STARS_ISA_dtyp = dt_dword;
-		SMP_msg("INFO: 32-bit binary detected.\n");
-	}
-	STARS_ISA_Bytewidth = (STARS_ISA_Bitwidth / 8);
-#endif
 
 	hook_to_notification_point(HT_IDP, idp_callback, NULL);
 #ifdef STARS_IRDB_INTERFACE
@@ -354,6 +343,7 @@ void IDAP_run(int arg) {
 	}
 
 	global_STARS_program->InitData();
+
 	global_STARS_program->DetermineRootFileName();
 	if (!(global_STARS_program->OpenFiles())) {
 		SMP_msg("FATAL ERROR: At least one file could not be opened.\n");
@@ -1470,7 +1460,7 @@ void FindOrphanedCode(STARS_Segment_t *CurrSeg, FILE *AnnotFile, FILE *InfoAnnot
 				bool IDAsuccess = SMP_generate_disasm_line(addr, disasm, sizeof(disasm) - 1);
 				if (IDAsuccess) {
 					// Remove interactive color-coding tags.
-					STARS_ssize_t StringLen = SMP_tag_remove(disasm, disasm, 0);
+					STARS_ssize_t StringLen = SMP_tag_remove(disasm, disasm, sizeof(disasm) - 1);
 					if (-1 >= StringLen) {
 						SMP_msg("ERROR: tag_remove failed at addr %lx \n", (unsigned long) addr);
 					}