diff --git a/bin/moduleutil/extractmodulepart.sh b/bin/moduleutil/extractmodulepart.sh
index 94b9c40272035a6591e8a6b730ee8bd7325098ab..9471bdd4cbac77a3e78795d81f097dc5f4f2ccc4 100755
--- a/bin/moduleutil/extractmodulepart.sh
+++ b/bin/moduleutil/extractmodulepart.sh
@@ -389,7 +389,12 @@ for MOD in $DEPENDING_MODULE_NAMES
 do
   if [ $MOD != $MODULE_NAME ]; then
     MODULE_DIR=${MOD%*/}
-    getVersionGit $MODULE_DIR $(pwd)/$MODULE_NAME/install$MODULE_NAME.sh >>$MODULE_NAME/$README_FILE
+    getVersionGit $MODULE_DIR $(pwd)/$MODULE_NAME/install$MODULE_NAME.sh | tee -a $MODULE_NAME/$README_FILE
+    grep "Error:" $MODULE_NAME/$README_FILE > /dev/null
+    EXIT_CODE=$?
+    if [[ $EXIT_CODE == 0 ]]; then
+      exit
+    fi
   fi
 done
 
diff --git a/bin/moduleutil/getusedversions.sh b/bin/moduleutil/getusedversions.sh
index 6dc2c1d9d4b3593a91eeafe8c3773ebde5e2fb54..102e2f0eed1d3eb3c00f69702232f9736162d1af 100755
--- a/bin/moduleutil/getusedversions.sh
+++ b/bin/moduleutil/getusedversions.sh
@@ -7,7 +7,7 @@
 # (c) 2016 Christoph Grüninger
 #
 
-if [ "${args[1]}" = "-h" ]; then
+if [ "$1" = "-h" ]; then
   echo "USAGE: ./getDumuxDuneVersions.sh"
   echo; exit
 fi
@@ -83,9 +83,9 @@ function getVersionGit
   cd ..
 }
 
-# run script from comand line
+# run script from command line
 # suppressed for use of external script when variable set accordingly
-if [ "$CALL_FROM_EXTERNAL_SCRIPT" == "no" ]; then
+if [ "$CALL_FROM_EXTERNAL_SCRIPT" != "yes" ]; then
   echo "# DUNE/DUMUX VERSIONS" > $OUTFILE
 
   echo "Creating file containing the version numbers:"