diff --git a/jedec.c b/jedec.c
index 69a59b3..f352c6b 100644
--- a/jedec.c
+++ b/jedec.c
@@ -262,7 +262,7 @@
 int write_page_write_jedec(struct flashchip *flash, uint8_t *src,
 			   int start, int page_size)
 {
-	int i, tried = 0, ok;
+	int i, tried = 0, failed;
 	uint8_t *s = src;
 	chipaddr bios = flash->virtual_memory;
 	chipaddr dst = bios + start;
@@ -287,27 +287,27 @@
 
 	dst = d;
 	src = s;
-	ok = !verify_range(flash, src, start, page_size, NULL);
+	failed = verify_range(flash, src, start, page_size, NULL);
 
-	if (!ok && tried++ < MAX_REFLASH_TRIES) {
+	if (failed && tried++ < MAX_REFLASH_TRIES) {
 		fprintf(stderr, "retrying.\n");
 		goto retry;
 	}
-	if (!ok) {
+	if (failed) {
 		fprintf(stderr, " page 0x%lx failed!\n",
 			(d - bios) / page_size);
 	}
-	return !ok;
+	return failed;
 }
 
 int write_byte_program_jedec(chipaddr bios, uint8_t *src,
 			     chipaddr dst)
 {
-	int tried = 0, ok = 1;
+	int tried = 0, failed = 0;
 
-	/* If the data is 0xFF, don't program it */
+	/* If the data is 0xFF, don't program it and don't complain. */
 	if (*src == 0xFF) {
-		return -1;
+		return 0;
 	}
 
 retry:
@@ -325,27 +325,32 @@
 	}
 
 	if (tried >= MAX_REFLASH_TRIES)
-		ok = 0;
+		failed = 1;
 
-	return !ok;
+	return failed;
 }
 
 int write_sector_jedec(chipaddr bios, uint8_t *src,
 		       chipaddr dst, unsigned int page_size)
 {
-	int i;
+	int i, failed = 0;
+	chipaddr olddst;
 
+	olddst = dst;
 	for (i = 0; i < page_size; i++) {
-		write_byte_program_jedec(bios, src, dst);
+		if (write_byte_program_jedec(bios, src, dst))
+			failed = 1;
 		dst++, src++;
 	}
+	if (failed)
+		fprintf(stderr, " writing sector at 0x%lx failed!\n", olddst);
 
-	return 0;
+	return failed;
 }
 
 int write_jedec(struct flashchip *flash, uint8_t *buf)
 {
-	int i;
+	int i, failed = 0;
 	int total_size = flash->total_size * 1024;
 	int page_size = flash->page_size;
 	chipaddr bios = flash->virtual_memory;
@@ -358,12 +363,13 @@
 	printf("Programming page: ");
 	for (i = 0; i < total_size / page_size; i++) {
 		printf("%04d at address: 0x%08x", i, i * page_size);
-		write_page_write_jedec(flash, buf + i * page_size,
-				       i * page_size, page_size);
+		if (write_page_write_jedec(flash, buf + i * page_size,
+					   i * page_size, page_size))
+			failed = 1;
 		printf("\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b\b");
 	}
 	printf("\n");
 	protect_jedec(bios);
 
-	return 0;
+	return failed;
 }
