Index: branches/eam_branches/20090522/psphot/src/psphotFindFootprints.c
===================================================================
--- branches/eam_branches/20090522/psphot/src/psphotFindFootprints.c	(revision 24529)
+++ branches/eam_branches/20090522/psphot/src/psphotFindFootprints.c	(revision 24557)
@@ -59,5 +59,5 @@
 
         psArray *mergedFootprints = pmFootprintArraysMerge(detections->footprints, footprints, includePeaks);
-        psLogMsg ("psphot", PS_LOG_MINUTIA, "merged %ld new footprints with %ld existing ones: %f sec\n", footprints->n, detections->footprints->n, psTimerMark ("psphot.footprints"));
+        psLogMsg ("psphot", PS_LOG_MINUTIA, "merged %ld new footprints with %ld existing ones: %f sec\n", footprints->n, (detections->footprints ? detections->footprints->n : 0), psTimerMark ("psphot.footprints"));
 
         psFree(footprints);
Index: branches/eam_branches/20090522/psphot/src/psphotMaskReadout.c
===================================================================
--- branches/eam_branches/20090522/psphot/src/psphotMaskReadout.c	(revision 24529)
+++ branches/eam_branches/20090522/psphot/src/psphotMaskReadout.c	(revision 24557)
@@ -27,5 +27,5 @@
     }
     if (!readout->variance) {
-        if (!pmReadoutGenerateVariance(readout, true)) {
+        if (!pmReadoutGenerateVariance(readout, NULL, true)) {
             psError (PSPHOT_ERR_CONFIG, false, "trouble creating variance");
             return false;
Index: branches/eam_branches/20090522/psphot/src/psphotReadoutMinimal.c
===================================================================
--- branches/eam_branches/20090522/psphot/src/psphotReadoutMinimal.c	(revision 24529)
+++ branches/eam_branches/20090522/psphot/src/psphotReadoutMinimal.c	(revision 24557)
@@ -46,5 +46,6 @@
 
     // find the detections (by peak and/or footprint) in the image.
-    pmDetections *detections = psphotFindDetections (NULL, readout, recipe);
+    pmDetections *detections = pmDetectionsAlloc(); // New detections; allocated to ensure pass=2
+    detections = psphotFindDetections(detections, readout, recipe);
     if (!detections) {
         psLogMsg ("psphot", 3, "unable to find detections in this image");
