Index: trunk/psphot/src/psphotCleanup.c
===================================================================
--- trunk/psphot/src/psphotCleanup.c	(revision 37609)
+++ trunk/psphot/src/psphotCleanup.c	(revision 37941)
@@ -10,4 +10,10 @@
 	(void)pmConfigRecipesCull(config,NULL);
         pmConfigDump(config, dump_file);
+    }
+
+    // if the program has stats write it out
+    psphotStatsFile *statsFile = psphotStatsFileGet();
+    if (statsFile) {
+        psphotStatsFileSave(config, statsFile);
     }
 
