diff --git a/wmake/wmakeCollect b/wmake/wmakeCollect
index 4a3525a3422a8ba95c4f2ef30a12757c6cf8a110..cace7450d4846415a26a3ef46b1f4859780564ff 100755
--- a/wmake/wmakeCollect
+++ b/wmake/wmakeCollect
@@ -157,4 +157,12 @@ else
     fi
 fi
 
+
+#------------------------------------------------------------------------------
+# Cleanup local variables and functions
+#------------------------------------------------------------------------------
+
+unset Script usage
+
+
 #------------------------------------------------------------------------------
diff --git a/wmake/wmakeLnIncludeAll b/wmake/wmakeLnIncludeAll
index 4aedc1257f71a60730f042d83af060a79acf98b8..06dc51e286b6631ef4bf4c5e2d02538f6ec963de 100755
--- a/wmake/wmakeLnIncludeAll
+++ b/wmake/wmakeLnIncludeAll
@@ -117,12 +117,13 @@ do
             then
                 # If running in parallel start wmakeLnInclude on nCores
                 # and more as the cores become free
-                if [ "$nCores" -gt 0 ]
+                if [ "$nCores" > 0 ]
                 then
                     joblist=($(jobs -p))
                     while (( ${#joblist[*]} > $nCores ))
                     do
-                        sleep 0.01
+                        # When the job limit is reached wait for a job to finish
+                        wait -n
                         joblist=($(jobs -p))
                     done
                     wmakeLnInclude -update $topDir &
@@ -138,22 +139,6 @@ do
     done
 done
 
-# If running in parallel wait until all wmakeLnInclude jobs are complete
-if [ "$nCores" -gt 0 ]
-then
-    for job in $(jobs -p)
-    do
-        echo $job
-        wait $job || let "FAIL+=1"
-    done
-
-    if [ "$FAIL" == "0" ];
-    then
-        echo "$Script: completed wmakeLnInclude processes"
-    else
-        echo "$Script: failed ($FAIL)"
-    fi
-fi
 
 #------------------------------------------------------------------------------
 # Cleanup local variables and functions