diff --git a/bootstrap/sbin/rebuild_system_from_scratch.sh b/bootstrap/sbin/rebuild_system_from_scratch.sh
index 8cf58c14af66d2f0158b0c2b3903924059232a63..640a72e53408ad44831329be7255d6d3c0da270c 100755
--- a/bootstrap/sbin/rebuild_system_from_scratch.sh
+++ b/bootstrap/sbin/rebuild_system_from_scratch.sh
@@ -1,7 +1,5 @@
 #! /usr/bin/env bash
 
-set -e
-
 HOME_DIR=${LOFAR20_DIR:-${PWD}}
 if [ ! -d ${HOME_DIR}/bootstrap ]; then
     # HOME_DIR/bootstrap needs to exist for this script to work.
@@ -25,6 +23,9 @@ else
     return 1
 fi
 
+# Any error should terminate this script.
+set -e
+
 # Save for the moment when tango will be cloned.
 OLD_HOME_DIR=${HOME_DIR}.old