diff --git a/chipset_enable.c b/chipset_enable.c
index fb0148c..8a4fd56 100644
--- a/chipset_enable.c
+++ b/chipset_enable.c
@@ -506,7 +506,7 @@
 		if (ret)
 			printf("Failed!\n");
 		else
-			printf("OK\n");
+			printf("OK.\n");
 	}
 
 	return ret;
diff --git a/layout.c b/layout.c
index 36d5da7..6f87dd6 100644
--- a/layout.c
+++ b/layout.c
@@ -40,21 +40,21 @@
 	}
 
 	if ((*walk) == 0 || ((*walk) & 0x3ff) != 0) {
-		printf("Flash image seems to be a legacy BIOS - disabling checks\n");
+		printf("Flash image seems to be a legacy BIOS. Disabling checks.\n");
 		mainboard_vendor = def_name;
 		mainboard_part = def_name;
 		return 0;
 	}
 
 	printf_debug("LinuxBIOS last image size "
-		     "(not ROM size) is %d bytes\n", *walk);
+		     "(not rom size) is %d bytes.\n", *walk);
 
 	walk--;
 	mainboard_part = strdup((const char *)(bios + size - *walk));
 	walk--;
 	mainboard_vendor = strdup((const char *)(bios + size - *walk));
-	printf_debug("Manufacturer: %s\n", mainboard_vendor);
-	printf_debug("Mainboard ID: %s\n", mainboard_part);
+	printf_debug("MANUFACTURER: %s\n", mainboard_vendor);
+	printf_debug("MAINBOARD ID: %s\n", mainboard_part);
 
 	/*
 	 * If lb_vendor is not set, the linuxbios table was
@@ -74,18 +74,18 @@
 	if (!strcasecmp(mainboard_vendor, lb_vendor) &&
 	    !strcasecmp(mainboard_part, lb_part)) {
 		printf_debug("This firmware image matches "
-			     "this motherboard\n");
+			     "this motherboard.\n");
 	} else {
 		if (force) {
 			printf("WARNING: This firmware image does not "
-			       "seem to fit to this machine - forcing it\n");
+			       "seem to fit to this machine - forcing it.\n");
 		} else {
 			printf("ERROR: Your firmware image (%s:%s) does not "
 			       "appear to\n       be correct for the detected "
 			       "mainboard (%s:%s)\n\nOverride with --force if you "
 			       "are absolutely sure that you\nare using a correct "
 			       "image for this mainboard or override\nthe detected "
-			       "values with --mainboard <vendor>:<mainboard>\n\n",
+			       "values with --mainboard <vendor>:<mainboard>.\n\n",
 			       mainboard_vendor, mainboard_part, lb_vendor,
 			       lb_part);
 			exit(1);
@@ -104,7 +104,7 @@
 	romlayout = fopen(name, "r");
 
 	if (!romlayout) {
-		fprintf(stderr, "ERROR: Could not open ROM layout (%s)\n",
+		fprintf(stderr, "ERROR: Could not open rom layout (%s).\n",
 			name);
 		return -1;
 	}
@@ -150,11 +150,11 @@
 	for (i = 0; i < romimages; i++) {
 		if (!strcmp(rom_entries[i].name, name)) {
 			rom_entries[i].included = 1;
-			printf("found\n");
+			printf("found.\n");
 			return i;
 		}
 	}
-	printf("not found\n");
+	printf("not found.\n");
 	// Not found. Error.
 
 	return -1;
diff --git a/lbtable.c b/lbtable.c
index 2365e15..a95f920 100644
--- a/lbtable.c
+++ b/lbtable.c
@@ -42,7 +42,8 @@
 		uint8_t byte[2];
 		uint16_t word;
 	} value;
-	unsigned long sum, i;
+	unsigned long sum;
+	unsigned long i;
 
 	/* In the most straight forward way possible,
 	 * compute an ip style checksum.
@@ -52,13 +53,15 @@
 	for (i = 0; i < length; i++) {
 		unsigned long value;
 		value = ptr[i];
-		if (i & 1)
+		if (i & 1) {
 			value <<= 8;
+		}
 		/* Add the new value */
 		sum += value;
 		/* Wrap around the carry */
-		if (sum > 0xFFFF)
+		if (sum > 0xFFFF) {
 			sum = (sum + (sum >> 16)) & 0xFFFF;
+		}
 	}
 	value.byte[0] = sum & 0xff;
 	value.byte[1] = (sum >> 8) & 0xff;
@@ -107,17 +110,17 @@
 			continue;
 		}
 		if (count_lb_records(head) != head->table_entries) {
-			fprintf(stderr, "Bad record count: %d\n",
+			fprintf(stderr, "bad record count: %d\n",
 				head->table_entries);
 			continue;
 		}
 		if (compute_checksum((uint8_t *) head, sizeof(*head)) != 0) {
-			fprintf(stderr, "Bad header checksum\n");
+			fprintf(stderr, "bad header checksum\n");
 			continue;
 		}
 		if (compute_checksum(recs, head->table_bytes)
 		    != head->table_checksum) {
-			fprintf(stderr, "Bad table checksum: %04x\n",
+			fprintf(stderr, "bad table checksum: %04x\n",
 				head->table_checksum);
 			continue;
 		}
@@ -137,7 +140,7 @@
 
 	rec = (struct lb_mainboard *)ptr;
 	max_size = rec->size - sizeof(*rec);
-	printf("Vendor ID: %.*s, part ID: %.*s\n",
+	printf("vendor id: %.*s part id: %.*s\n",
 	       max_size - rec->vendor_idx,
 	       rec->strings + rec->vendor_idx,
 	       max_size - rec->part_number_idx,
@@ -148,7 +151,7 @@
 		 rec->strings + rec->part_number_idx);
 
 	if (lb_part) {
-		printf("Overwritten by command line, vendor ID: %s, part ID: %s\n", lb_vendor, lb_part);
+		printf("overwritten by command line, vendor id: %s part id: %s\n", lb_vendor, lb_part);
 	} else {
 		lb_part = strdup(part);
 		lb_vendor = strdup(vendor);
@@ -198,7 +201,7 @@
 	if (lb_table) {
 		unsigned long addr;
 		addr = ((char *)lb_table) - ((char *)low_1MB);
-		printf_debug("LinuxBIOS table found at address %p\n", lb_table);
+		printf_debug("lb_table found at address %p\n", lb_table);
 		rec = (struct lb_record *)(((char *)lb_table) + lb_table->header_bytes);
 		last = (struct lb_record *)(((char *)rec) + lb_table->table_bytes);
 		printf_debug("LinuxBIOS header(%d) checksum: %04x table(%d) checksum: %04x entries: %d\n",
@@ -207,7 +210,7 @@
 		     lb_table->table_entries);
 		search_lb_records(rec, last, addr + lb_table->header_bytes);
 	} else {
-		printf("No LinuxBIOS table found\n");
+		printf("No LinuxBIOS table found.\n");
 		return -1;
 	}
 
diff --git a/udelay.c b/udelay.c
index 1bab27d..2026d3e 100644
--- a/udelay.c
+++ b/udelay.c
@@ -56,5 +56,5 @@
 	micro = count / timeusec;
 
 	printf_debug("%ldM loops per second. ", (unsigned long)micro);
-	printf("OK\n");
+	printf("ok\n");
 }
