Index: trunk/ppStack/src/ppStackLoop.c
===================================================================
--- trunk/ppStack/src/ppStackLoop.c	(revision 14834)
+++ trunk/ppStack/src/ppStackLoop.c	(revision 15224)
@@ -35,4 +35,9 @@
     if (!input) {
         psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find input data!\n");
+        return false;
+    }
+    pmFPAfile *output = psMetadataLookupPtr(NULL, config->files, "PPSTACK.OUTPUT"); // Output file
+    if (!output) {
+        psError(PS_ERR_UNEXPECTED_NULL, false, "Can't find output data!\n");
         return false;
     }
@@ -87,5 +92,5 @@
             // Perform statistics on the cell
             if (stats) {
-                ppStatsFPA(stats, input->fpa, view, maskBlank, config);
+                ppStatsFPA(stats, output->fpa, view, maskBlank, config);
             }
 
