Index: /branches/eam_branches/ipp-20211108/psphot/src/psphotBlendFit.c
===================================================================
--- /branches/eam_branches/ipp-20211108/psphot/src/psphotBlendFit.c	(revision 42020)
+++ /branches/eam_branches/ipp-20211108/psphot/src/psphotBlendFit.c	(revision 42021)
@@ -79,5 +79,5 @@
 
     fitOptions->nIter         = psMetadataLookupS32(&status, recipe, "EXT_FIT_ITER"); // Max number of fit iterations
-    assert (status && fitIter > 0); 
+    assert (status && fitOptions->nIter > 0); 
 
     fitOptions->minTol = psMetadataLookupF32 (&status, recipe, "EXT_FIT_MIN_TOL"); // Fit tolerance
Index: /branches/eam_branches/ipp-20211108/psphot/src/psphotFindPeaks.c
===================================================================
--- /branches/eam_branches/ipp-20211108/psphot/src/psphotFindPeaks.c	(revision 42020)
+++ /branches/eam_branches/ipp-20211108/psphot/src/psphotFindPeaks.c	(revision 42021)
@@ -41,14 +41,20 @@
 	    // psVectorStats will only fail due to a programming error (e.g., invalid vector type)
 	    psError(PSPHOT_ERR_UNKNOWN, false, "Unable to perform statistics to measure image quality");
+	    psFree (SNvalues);
 	    return NULL;
 	}
+	psFree (SNvalues);
+
 	if (!isfinite(stats->sampleMedian)) {
 	    // could not determine relationship between SN threshold and image values
 	    // XXX fall-back could be the standard analysis above.
 	    psLogMsg ("psphot", PS_LOG_INFO, "failure to map SN to image values");
+	    psFree (stats);
 	    goto use_significance;
 	}
 	
 	float alt_threshold = stats->sampleMedian;
+	psFree (stats);
+
 	peaks = pmPeaksInImage (significance->image, alt_threshold);
 	if (peaks == NULL) {
