Index: trunk/ppMerge/src/ppMergeLoop.c
===================================================================
--- trunk/ppMerge/src/ppMergeLoop.c	(revision 17227)
+++ trunk/ppMerge/src/ppMergeLoop.c	(revision 17319)
@@ -59,4 +59,12 @@
     combination->weights = useWeights;
 
+    psMetadata *stats = NULL;           // Statistics for output
+    if (psMetadataLookup(config->arguments, "STATS.NAME")) {
+        stats = psMetadataAlloc();
+        psMetadataAddMetadata(config->arguments, PS_LIST_TAIL, "STATS.DATA", 0, "Statistics output", stats);
+    }
+
+    pmFPAview *view = pmFPAviewAlloc(0); // View to component of interest
+
     // Retrieve data placed on analysis
     psVector *scales = NULL, *zeros = NULL; // Scale and zeroes for combination
@@ -96,9 +104,4 @@
     psString darkNorm = psMetadataLookupStr(&mdok, arguments, "DARK.NORM"); // Dark normalisation
 
-    psMetadata *stats = NULL;           // Statistics for output
-    if (psMetadataLookup(config->arguments, "STATS.NAME")) {
-        stats = psMetadataAlloc();
-        psMetadataAddMetadata(config->arguments, PS_LIST_TAIL, "STATS.DATA", 0, "Statistics output", stats);
-    }
 
     if (!ppMergeFileActivate(config, PPMERGE_FILES_ALL, true)) {
@@ -111,5 +114,4 @@
     assert(output && output->fpa);
     pmFPA *outFPA = output->fpa;        // Output FPA
-    pmFPAview *view = pmFPAviewAlloc(0); // View to component of interest
     int cellNum = 0;                    // Index of cell
     if (!pmFPAfileIOChecks(config, view, PM_FPA_BEFORE)) {
