Index: trunk/psphot/src/psphotReadout.c
===================================================================
--- trunk/psphot/src/psphotReadout.c	(revision 6862)
+++ trunk/psphot/src/psphotReadout.c	(revision 6964)
@@ -3,11 +3,6 @@
 bool psphotReadout (pmConfig *config, pmFPAview *view) {
 
-    psArray     *sources  = NULL;
-    psArray     *peaks    = NULL;
-    pmPSF       *psf      = NULL;
-    bool         status;
-
     // select the current recipe
-    psMetadata *recipe  = psMetadataLookupPtr (&status, config->recipes, "PSPHOT");
+    psMetadata *recipe  = psMetadataLookupPtr (NULL, config->recipes, "PSPHOT");
 
     // find the currently selected readout
@@ -28,9 +23,9 @@
 
     // find the peaks in the image
-    peaks = psphotFindPeaks (readout, recipe);
+    psArray *peaks = psphotFindPeaks (readout, recipe);
 
     // construct sources and measure basic stats
     // limit moments analysis by S/N?
-    sources = psphotSourceStats (readout, recipe, peaks);
+    psArray *sources = psphotSourceStats (readout, recipe, peaks);
 
     // classify sources based on moments, brightness
@@ -42,5 +37,5 @@
 
     // use bright stellar objects to measure PSF
-    psf = psphotChoosePSF (readout, sources, recipe);
+    pmPSF *psf = psphotChoosePSF (readout, sources, recipe);
     psphotPSFstats (readout, recipe, psf);
 
@@ -76,7 +71,7 @@
 
     // save the results of the analysis 
-    status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY,    "psphot sources", sources);
-    status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER",  PS_DATA_METADATA, "header stats", header);
-    status = psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF",     PS_DATA_UNKNOWN,  "psphot psf", psf);
+    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.SOURCES", PS_DATA_ARRAY,    "psphot sources", sources);
+    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.HEADER",  PS_DATA_METADATA, "header stats", header);
+    psMetadataAdd (readout->analysis, PS_LIST_TAIL, "PSPHOT.PSF",     PS_DATA_UNKNOWN,  "psphot psf", psf);
 
     // remove internal pmFPAfiles, if created
@@ -85,8 +80,8 @@
 
     // free up the local copies of the data
+    psFree (peaks);
+    psFree (sources);
     psFree (psf);
     psFree (header);
-    psFree (sources);
-    psFree (peaks);
     return true;
 }
