diff --git a/ichspi.c b/ichspi.c
index bad2e2781f0a5989130b9b319a8a57b23629f7ff..5de654bf7149721e626646e2682a9da1cc99d6da 100644
--- a/ichspi.c
+++ b/ichspi.c
@@ -289,7 +289,6 @@ int program_opcodes(OPCODES * op)
 	uint32_t opmenu[2];
 
 	/* Program Prefix Opcodes */
-	preop = 0;
 	/* 0:7 Prefix Opcode 1 */
 	preop = (op->preop[0]);
 	/* 8:16 Prefix Opcode 2 */
diff --git a/m29f002.c b/m29f002.c
index a8365873ea66f77bcbc112651ac667cfc6e55394..8afef796ee457287e13c1140cb76297e65a68ff0 100644
--- a/m29f002.c
+++ b/m29f002.c
@@ -77,7 +77,7 @@ int write_m29f002t(struct flashchip *flash, uint8_t *buf) {
 	do_block(bios, buf, i++, 0x30000, 32*1024);
 	do_block(bios, buf, i++, 0x38000, 8*1024);
 	do_block(bios, buf, i++, 0x3a000, 8*1024);
-	do_block(bios, buf, i++, 0x3c000, 16*1024);
+	do_block(bios, buf, i, 0x3c000, 16*1024);
 
 	printf("\n");
 	return 0;