--- a/src/gpib/gpib_write.cc
+++ b/src/gpib/gpib_write.cc
@@ -68,7 +68,7 @@
     {
         retval = gpib->write(args(1).string_value());
     }
-    else if (args(1).byte_size() == args(1).numel()) // uint8_t
+    else if (args(1).is_uint8_type ()) // uint8_t
     {
         NDArray data = args(1).array_value();
         uint8_t* buf = NULL;