diff --git a/util-linux/fsck_minix.c b/util-linux/fsck_minix.c
index 9e885dc..44bcd33 100644
--- a/util-linux/fsck_minix.c
+++ b/util-linux/fsck_minix.c
@@ -122,7 +122,11 @@
 	uint32_t i_zone[10];
 };
 
+/* Believe it or not, but mount.h has this one */
+#undef BLOCK_SIZE
 enum {
+	BLOCK_SIZE = 1024,
+
 	MINIX_ROOT_INO = 1,
 	MINIX_LINK_MAX = 250,
 	MINIX2_LINK_MAX = 65530,
@@ -190,7 +194,7 @@
 
 #define BITS_PER_BLOCK (BLOCK_SIZE<<3)
 
-static char *program_version = "1.2 - 11/11/96";
+#define PROGRAM_VERSION "1.2 - 11/11/96"
 static char *device_name;
 static int IN;
 static smallint repair, automatic, verbose, list, show, warn_mode, force;
@@ -335,7 +339,8 @@
 	printf(def ? "%s (y/n)? " : "%s (n/y)? ", string);
 	for (;;) {
 		fflush(stdout);
-		if ((c = getchar()) == EOF) {
+		c = getchar();
+		if (c == EOF) {
 			if (!def)
 				errors_uncorrected = 1;
 			return def;
@@ -371,7 +376,8 @@
 	int cont;
 	int fd;
 
-	if ((f = setmntent(MOUNTED, "r")) == NULL)
+	f = setmntent(MOUNTED, "r");
+	if (f == NULL)
 		return;
 	while ((mnt = getmntent(f)) != NULL)
 		if (strcmp(device_name, mnt->mnt_fsname) == 0)
@@ -388,8 +394,7 @@
 	fd = open(MOUNTED, O_RDWR);
 	if (fd < 0 && errno == EROFS)
 		return;
-	else
-		close(fd);
+	close(fd);
 
 	printf("%s is mounted. ", device_name);
 	cont = 0;
@@ -585,16 +590,14 @@
 	 * are uncorrected errors.  The filesystem valid flag is
 	 * unconditionally set if we get this far.
 	 */
-	Super.s_state |= MINIX_VALID_FS;
-	if (errors_uncorrected)
-		Super.s_state |= MINIX_ERROR_FS;
-	else
+	Super.s_state |= MINIX_VALID_FS | MINIX_ERROR_FS;
+	if (!errors_uncorrected)
 		Super.s_state &= ~MINIX_ERROR_FS;
 
 	if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
 		die("seek failed in write_super_block");
 	if (BLOCK_SIZE != write(IN, super_block_buffer, BLOCK_SIZE))
-		die("unable to write super-block");
+		die("cannot write super-block");
 }
 
 static void write_tables(void)
@@ -602,11 +605,11 @@
 	write_super_block();
 
 	if (IMAPS * BLOCK_SIZE != write(IN, inode_map, IMAPS * BLOCK_SIZE))
-		die("unable to write inode map");
+		die("cannot write inode map");
 	if (ZMAPS * BLOCK_SIZE != write(IN, zone_map, ZMAPS * BLOCK_SIZE))
-		die("unable to write zone map");
+		die("cannot write zone map");
 	if (INODE_BUFFER_SIZE != write(IN, inode_buffer, INODE_BUFFER_SIZE))
-		die("unable to write inodes");
+		die("cannot write inodes");
 }
 
 static void get_dirsize(void)
@@ -637,7 +640,7 @@
 	if (BLOCK_SIZE != lseek(IN, BLOCK_SIZE, SEEK_SET))
 		die("seek failed");
 	if (BLOCK_SIZE != read(IN, super_block_buffer, BLOCK_SIZE))
-		die("unable to read super block");
+		die("cannot read super block");
 	/* already initialized to:
 	namelen = 14;
 	dirsize = 16;
@@ -673,11 +676,11 @@
 	inode_count = xmalloc(INODES + 1);
 	zone_count = xmalloc(ZONES);
 	if (IMAPS * BLOCK_SIZE != read(IN, inode_map, IMAPS * BLOCK_SIZE))
-		die("unable to read inode map");
+		die("cannot read inode map");
 	if (ZMAPS * BLOCK_SIZE != read(IN, zone_map, ZMAPS * BLOCK_SIZE))
-		die("unable to read zone map");
+		die("cannot read zone map");
 	if (INODE_BUFFER_SIZE != read(IN, inode_buffer, INODE_BUFFER_SIZE))
-		die("unable to read inodes");
+		die("cannot read inodes");
 	if (NORM_FIRSTZONE != FIRSTZONE) {
 		printf("warning: firstzone!=norm_firstzone\n");
 		errors_uncorrected = 1;
@@ -1024,18 +1027,16 @@
 	inode = get_inode(ino);
 	pop_filename();
 	if (!offset) {
-		if (!inode || strcmp(".", name)) {
-			printf("%s: bad directory: '.' isn't first\n", current_name);
-			errors_uncorrected = 1;
-		} else
+		if (inode && LONE_CHAR(name, '.'))
 			return;
+		printf("%s: bad directory: '.' isn't first\n", current_name);
+		errors_uncorrected = 1;
 	}
 	if (offset == dirsize) {
-		if (!inode || strcmp("..", name)) {
-			printf("%s: bad directory: '..' isn't second\n", current_name);
-			errors_uncorrected = 1;
-		} else
+		if (inode && strcmp("..", name) == 0)
 			return;
+		printf("%s: bad directory: '..' isn't second\n", current_name);
+		errors_uncorrected = 1;
 	}
 	if (!inode)
 		return;
@@ -1077,18 +1078,16 @@
 	inode = get_inode2(ino);
 	pop_filename();
 	if (!offset) {
-		if (!inode || strcmp(".", name)) {
-			printf("%s: bad directory: '.' isn't first\n", current_name);
-			errors_uncorrected = 1;
-		} else
+		if (inode && LONE_CHAR(name, '.'))
 			return;
+		printf("%s: bad directory: '.' isn't first\n", current_name);
+		errors_uncorrected = 1;
 	}
 	if (offset == dirsize) {
-		if (!inode || strcmp("..", name)) {
-			printf("%s: bad directory: '..' isn't second\n", current_name);
-			errors_uncorrected = 1;
-		} else
+		if (inode && strcmp("..", name) == 0)
 			return;
+		printf("%s: bad directory: '..' isn't second\n", current_name);
+		errors_uncorrected = 1;
 	}
 	if (!inode)
 		return;
@@ -1141,7 +1140,7 @@
 
 static int bad_zone(int i)
 {
-	char buffer[1024];
+	char buffer[BLOCK_SIZE];
 
 	if (BLOCK_SIZE * i != lseek(IN, BLOCK_SIZE * i, SEEK_SET))
 		die("seek failed in bad_zone");
@@ -1276,6 +1275,8 @@
 	struct termios tmp;
 	int retcode = 0;
 
+	xfunc_exitcode = 8;
+
 	alloc_current_name();
 #ifdef CONFIG_FEATURE_CLEAN_UP
 	/* Don't bother to free memory.  Exit does
@@ -1289,15 +1290,14 @@
 	if (INODE_SIZE2 * MINIX2_INODES_PER_BLOCK != BLOCK_SIZE)
 		die("bad v2 inode size");
 #endif
-	while (argc-- > 1) {
+	while (--argc != 0) {
 		argv++;
 		if (argv[0][0] != '-') {
 			if (device_name)
 				bb_show_usage();
-			else
-				device_name = argv[0];
-		} else
-			while (*++argv[0])
+			device_name = argv[0];
+		} else {
+			while (*++argv[0]) {
 				switch (argv[0][0]) {
 				case 'l':
 					list = 1;
@@ -1325,9 +1325,12 @@
 				default:
 					bb_show_usage();
 				}
+			}
+		}
 	}
 	if (!device_name)
 		bb_show_usage();
+
 	check_mount();				/* trying to check a mounted filesystem? */
 	if (repair && !automatic) {
 		if (!isatty(0) || !isatty(1))
@@ -1335,10 +1338,9 @@
 	}
 	IN = open(device_name, repair ? O_RDWR : O_RDONLY);
 	if (IN < 0) {
-		printf("unable to open device '%s'\n", device_name);
-		leave(8);
+		bb_error_msg_and_die("cannot open device '%s'", device_name);
 	}
-	sync(); /* paranoia? */
+	/*sync(); paranoia? */
 	read_superblock();
 
 	/*
@@ -1347,13 +1349,14 @@
 	 * flags and whether or not the -f switch was specified on the
 	 * command line.
 	 */
-	printf("%s, %s\n", applet_name, program_version);
+	printf("%s, "PROGRAM_VERSION"\n", applet_name);
+
 	if (!(Super.s_state & MINIX_ERROR_FS)
 	 && (Super.s_state & MINIX_VALID_FS) && !force
 	) {
 		if (repair)
 			printf("%s is clean, check is skipped\n", device_name);
-		return retcode;
+		return 0;
 	} else if (force)
 		printf("Forcing filesystem check on %s\n", device_name);
 	else if (repair)
