diff --git a/fmt.sh b/fmt.sh
index 8e925fc0260e88e0b6f7905b276db1cd3d5d426d..4e2cf0508534331239b0478c7240b15f8f6eef0d 100755
--- a/fmt.sh
+++ b/fmt.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 ARGS=()
 
 for crate in relibc $(find src -name Cargo.toml | cut -d '/' -f2 | grep -v template)
diff --git a/src/ctype/src/lib.rs b/src/ctype/src/lib.rs
index 5819a32ea9ac04817a872568ca7250159abc92fb..bcbc443f538c7303c285253f95e6731254e57c9a 100644
--- a/src/ctype/src/lib.rs
+++ b/src/ctype/src/lib.rs
@@ -21,6 +21,11 @@ pub extern "C" fn isascii(c: c_int) -> c_int {
     (!(c & !0x7f)) as c_int
 }
 
+#[no_mangle]
+pub extern "C" fn isblank(c: c_int) -> c_int {
+    (c == ' ' as c_int || c == '\t' as c_int) as c_int
+}
+
 #[no_mangle]
 pub extern "C" fn iscntrl(c: c_int) -> c_int {
     ((c as c_uint) < 0x20 || c == 0x7f) as c_int
@@ -48,7 +53,7 @@ pub extern "C" fn isprint(c: c_int) -> c_int {
 
 #[no_mangle]
 pub extern "C" fn ispunct(c: c_int) -> c_int {
-    (isgraph(c) == 0 && !isalnum(c) == 0) as c_int
+    (isgraph(c) != 0 && !isalnum(c) != 0) as c_int
 }
 
 #[no_mangle]
@@ -63,17 +68,12 @@ pub extern "C" fn isupper(c: c_int) -> c_int {
 
 #[no_mangle]
 pub extern "C" fn isxdigit(c: c_int) -> c_int {
-    (isdigit(c) == 0 || ((c as c_int) | 32) - ('a' as c_int) < 6) as c_int
-}
-
-#[no_mangle]
-pub extern "C" fn isblank(c: c_int) -> c_int {
-    (c == ' ' as c_int || c == '\t' as c_int) as c_int
+    (isdigit(c) != 0 || ((c as c_int) | 32) - ('a' as c_int) < 6) as c_int
 }
 
 #[no_mangle]
 /// The comment in musl:
-/// nonsense function that should NEVER be used!
+/// "nonsense function that should NEVER be used!"
 pub extern "C" fn toascii(c: c_int) -> c_int {
     c & 0x7f
 }
diff --git a/test.sh b/test.sh
index cb7f9eba968969434aef81390628688564b33390..27f033bb6326016a7e1480e2a30fd9e67380229e 100755
--- a/test.sh
+++ b/test.sh
@@ -1,3 +1,4 @@
+#!/bin/bash
 set -ex
 
 cargo build
diff --git a/tests/ctype.c b/tests/ctype.c
index 76b68195101478152570383a075f0f286fa8affd..52836f2336fbda6231afb06267b53713ebf6b86a 100644
--- a/tests/ctype.c
+++ b/tests/ctype.c
@@ -6,17 +6,28 @@ struct test_case {
     int isalnum;
     int isalpha;
     int isascii;
+    int isblank;
+    int iscntrl;
     int isdigit;
+    int isgraph;
     int islower;
+    int isprint;
+    int ispunct;
     int isspace;
     int isupper;
+    int isxdigit;
 } test_cases[] = {
-    { 'A', 1, 1, 1, 0, 0, 0, 1},
-    { 'z', 1, 1, 1, 0, 1, 0, 0},
-    { ' ', 0, 0, 1, 0, 0, 1, 0},
-    { '1', 1, 0, 1, 1, 0, 0, 0},
-    { '9', 1, 0, 1, 1, 0, 0, 0},
-    {0x80, 0, 0, 0, 0, 0, 0, 0}
+    //     a  a  a  b  c  d  g  l  p  p  s  u  x
+    //     l  l  s  l  n  i  r  o  r  u  p  p  d
+    //     n  p  c  a  t  g  a  w  i  n  a  p  i
+    //     u  h  i  n  r  i  p  e  n  c  c  e  g
+    //     m  a  i  k  l  t  h  r  t  t  e  r  i
+    { 'A', 1, 1, 1, 0, 0, 0, 1, 0, 1, 0, 0, 1, 1},
+    { 'z', 1, 1, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0},
+    { ' ', 0, 0, 1, 1, 0, 0, 0, 0, 1, 0, 1, 0, 0},
+    { '1', 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1},
+    { '9', 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 0, 0, 1},
+    {0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}
 };
 size_t num_test_cases = sizeof(test_cases)/sizeof(struct test_case);