Index: trunk/FACT++/scripts/CheckUnderflow.js
===================================================================
--- trunk/FACT++/scripts/CheckUnderflow.js	(revision 17498)
+++ trunk/FACT++/scripts/CheckUnderflow.js	(revision 17535)
@@ -27,4 +27,11 @@
 
 console.out(("\n%78s".$("")).replace(/ /g, "="));
+
+if (dim.state("FTM_CONTROL").name=="TriggerOn")
+{
+    dim.send("FTM_CONTROL/STOP_TRIGGER");
+    dim.wait("FTM_CONTROL", "Valid");
+}
+
 
 include('scripts/CheckStates.js');
@@ -93,5 +100,5 @@
 
         console.out("Waiting for open files to be closed...");
-        v8.timeout(60000, function() { if (sub_runs.get(false).qos==0) return true; });
+        v8.timeout(60000, function() { if (sub_runs.get(0, false).qos==0) return true; });
 
         // Although the file should be closed now, the processing might still be on-going
