Index: trunk/ppStack/src/ppStack.c
===================================================================
--- trunk/ppStack/src/ppStack.c	(revision 27159)
+++ trunk/ppStack/src/ppStack.c	(revision 27160)
@@ -24,4 +24,5 @@
 
     pmConfig *config = pmConfigRead(&argc, argv, PPSTACK_RECIPE); // Configuration
+    ppStackOptions *options = NULL;                               // Options for stacking
     if (!config) {
         goto die;
@@ -54,5 +55,6 @@
     }
 
-    if (!ppStackLoop(config)) {
+    options = ppStackOptionsAlloc();
+    if (!ppStackLoop(config, options)) {
         goto die;
     }
@@ -76,4 +78,32 @@
             }
         }
+
+        // Write out summary statistics
+        if (options && options->stats) {
+
+            psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
+                             "Bad data quality flag", options->quality);
+            psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_STACK", 0,
+                             "Total time", psTimerClear("PPSTACK_TOTAL"));
+
+            const char *statsMDC = psMetadataConfigFormat(options->stats);
+            if (!statsMDC || strlen(statsMDC) == 0) {
+                psError(PS_ERR_IO, false, "Unable to get statistics MDC file.");
+                return false;
+            }
+            if (fprintf(options->statsFile, "%s", statsMDC) != strlen(statsMDC)) {
+                psError(PS_ERR_IO, false, "Unable to write statistics MDC file.");
+                return false;
+            }
+            psFree(statsMDC);
+            if (fclose(options->statsFile) == EOF) {
+                psError(PS_ERR_IO, false, "Unable to close statistics MDC file.");
+                return false;
+            }
+            options->statsFile = NULL;
+            pmConfigRunFilenameAddWrite(config, "STATS",
+                                        psMetadataLookupStr(NULL, config->arguments, "STATS"));
+        }
+        psFree(options);
 
         // Dump configuration
Index: trunk/ppStack/src/ppStackFinish.c
===================================================================
--- trunk/ppStack/src/ppStackFinish.c	(revision 27159)
+++ trunk/ppStack/src/ppStackFinish.c	(revision 27160)
@@ -68,30 +68,4 @@
     psFree(options->outRO); options->outRO = NULL;
 
-    // Write out summary statistics
-    if (options->stats) {
-
-        psMetadataAddS32(options->stats, PS_LIST_TAIL, "QUALITY", PS_META_REPLACE,
-                         "Bad data quality flag", options->quality);
-        psMetadataAddF32(options->stats, PS_LIST_TAIL, "TIME_STACK", 0,
-                         "Total time", psTimerClear("PPSTACK_TOTAL"));
-
-        const char *statsMDC = psMetadataConfigFormat(options->stats);
-        if (!statsMDC || strlen(statsMDC) == 0) {
-            psError(PS_ERR_IO, false, "Unable to get statistics MDC file.");
-            return false;
-        }
-        if (fprintf(options->statsFile, "%s", statsMDC) != strlen(statsMDC)) {
-            psError(PS_ERR_IO, false, "Unable to write statistics MDC file.");
-            return false;
-        }
-        psFree(statsMDC);
-        if (fclose(options->statsFile) == EOF) {
-            psError(PS_ERR_IO, false, "Unable to close statistics MDC file.");
-            return false;
-        }
-        options->statsFile = NULL;
-        pmConfigRunFilenameAddWrite(config, "STATS", psMetadataLookupStr(NULL, config->arguments, "STATS"));
-    }
-
     return true;
 }
Index: trunk/ppStack/src/ppStackLoop.c
===================================================================
--- trunk/ppStack/src/ppStackLoop.c	(revision 27159)
+++ trunk/ppStack/src/ppStackLoop.c	(revision 27160)
@@ -50,5 +50,5 @@
 
 
-bool ppStackLoop(pmConfig *config)
+bool ppStackLoop(pmConfig *config, ppStackOptions *options)
 {
     assert(config);
@@ -56,6 +56,4 @@
     psTimerStart("PPSTACK_TOTAL");
     psTimerStart("PPSTACK_STEPS");
-
-    ppStackOptions *options = ppStackOptionsAlloc(); // Options for stacking
 
     // Setup
@@ -222,5 +220,4 @@
         return false;
     }
-    psLogMsg("ppStack", PS_LOG_INFO, "Stage 9: Final output: %f sec", psTimerClear("PPSTACK_STEPS"));
     ppStackMemDump("finish");
 
Index: trunk/ppStack/src/ppStackLoop.h
===================================================================
--- trunk/ppStack/src/ppStackLoop.h	(revision 27159)
+++ trunk/ppStack/src/ppStackLoop.h	(revision 27160)
@@ -11,5 +11,6 @@
 // Loop over the inputs, doing the combination
 bool ppStackLoop(
-    pmConfig *config                    // Configuration
+    pmConfig *config,                    // Configuration
+    ppStackOptions *options             // Options for stacking
     );
 
