Index: branches/eam_branches/psphot.stack.20100120/src/psphotFitSourcesLinear.c
===================================================================
--- branches/eam_branches/psphot.stack.20100120/src/psphotFitSourcesLinear.c	(revision 26681)
+++ branches/eam_branches/psphot.stack.20100120/src/psphotFitSourcesLinear.c	(revision 26688)
@@ -44,10 +44,13 @@
     // find the currently selected readout
     pmFPAfile *file = pmFPAfileSelectSingle(config->files, filename, index); // File of interest
-    psAssert (readout, "missing file?");
+    psAssert (file, "missing file?");
 
     pmReadout *readout = pmFPAviewThisReadout(view, file->fpa);
     psAssert (readout, "missing readout?");
 
-    psArray *sources = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.SOURCES");
+    pmDetections *detections = psMetadataLookupPtr (&status, readout->analysis, "PSPHOT.DETECTIONS");
+    psAssert (detections, "missing detections?");
+
+    psArray *sources = detections->allSources;
     psAssert (sources, "missing sources?");
 
