Index: trunk/psphot/src/psphotApResid.c
===================================================================
--- trunk/psphot/src/psphotApResid.c	(revision 6862)
+++ trunk/psphot/src/psphotApResid.c	(revision 6866)
@@ -14,4 +14,7 @@
     // S/N limit to perform full non-linear fits
     float FIT_SN_LIM = psMetadataLookupF32 (&status, recipe, "FULL_FIT_SN_LIM");
+
+    // set limits on the aperture magnitudes 
+    pmSourceMagnitudesInit (recipe);
 
     // measure the aperture loss as a function of radius for PSF
@@ -40,10 +43,12 @@
 	if (source->mode &  PM_SOURCE_MODE_POOR) continue;
 
+	model = source->modelPSF;
+	if (model == NULL) continue;
+
 	// XXX tune independently?
 	if (source->moments->SN < 2*FIT_SN_LIM) continue;
 
 	// get growth-corrected, apTrend-uncorrected magnitudes in scaled apertures
-	model = pmSourceMagnitudes (source, psf, true, false);
-	if (model == NULL) continue;
+	if (!pmSourceMagnitudes (source, psf, PM_SOURCE_PHOT_GROWTH)) continue;
 
 	apResid->data.F64[Npsf] = source->apMag - source->psfMag;
@@ -225,5 +230,5 @@
     psf->ApTrend->coeff[0][0][1][0] = 0;
     psf->ApTrend->coeff[0][0][0][1] = 0;
-    psf->nApResid = residStats->clippedNvalues;
+    psf->nApResid = Npsf;
 
     // save results for later output
