diff --git a/bin/build b/bin/build
index 5fc33f5f037e3d140f5e417c0d337959c918c142..14f4b8383fc6842fa327124cc3920e64cdccd300 100755
--- a/bin/build
+++ b/bin/build
@@ -1,5 +1,7 @@
 #!/usr/bin/env bash
 
+set -e
+
 # Generate the resources/version.properties file
 version() {
     VERSION_INFO=$(./bin/version)
diff --git a/bin/build-drivers.sh b/bin/build-drivers.sh
index a5a21dee02ee3d189a0f41724f140c37da3d5a82..f6a00f411b8cdcfa07cf928761213b049b82d397 100755
--- a/bin/build-drivers.sh
+++ b/bin/build-drivers.sh
@@ -19,7 +19,7 @@ if [ "$1" == clean ]; then
     done
 fi
 
-for driver in `ls modules/drivers/ | perl -pe 's|/$||'`; do # strip trailing slashes if `ls` is set to include them
+for driver in `ls modules/drivers/ | sed 's|/$||'`; do # strip trailing slashes if `ls` is set to include them
     echo "Build: $driver"
     ./bin/build-driver.sh "$driver"
 done