Index: /trunk/FACT++/scripts/CheckUnderflow.js
===================================================================
--- /trunk/FACT++/scripts/CheckUnderflow.js	(revision 15070)
+++ /trunk/FACT++/scripts/CheckUnderflow.js	(revision 15071)
@@ -108,5 +108,5 @@
     dim.wait("MCP", "Idle", 3000);
 
-    var nn = run.data && runs.data.length>0 && runs.obj['roi']>0 ? runs.obj['run'][1].reduce(Func.max) : -1;
+    var nn = runs.data && runs.data.length>0 && runs.obj['roi']>0 ? runs.obj['run'].reduce(Func.max) : -1;
     if (nn>0)
     {
@@ -160,11 +160,11 @@
     // Rms[max]=44.0                 Rms[max]=382.1
 
-    if (stat0.count==0)
-        return;
+    if (stat0.count>0)
+    {
+        if (stat0.count>8)
+            throw new Error("Underflow condition detected in about "+stat0.count/9+" DRS.");
 
-    if (stat0.count>8)
-        throw new Error("Underflow condition detected in about "+stat0.count/9+" DRS.");
-
-    log.warn("There is probably an underflow condition in one DRS... please check manually.");
+        log.warn("There is probably an underflow condition in one DRS... please check manually.");
+    }
 }
 
