Index: trunk/psModules/src/objects/pmPSFtry.c
===================================================================
--- trunk/psModules/src/objects/pmPSFtry.c	(revision 21183)
+++ trunk/psModules/src/objects/pmPSFtry.c	(revision 23989)
@@ -211,5 +211,5 @@
 
     if (Next == 0) {
-        psError(PS_ERR_UNKNOWN, true, "No sources with good extended fits from which to determine PSF.");
+        psError(PS_ERR_UNKNOWN, false, "No sources with good extended fits from which to determine PSF.");
         psFree(psfTry);
         return NULL;
@@ -282,5 +282,5 @@
 
     if (Npsf == 0) {
-        psError(PS_ERR_UNKNOWN, true, "No sources with good PSF fits after model is built.");
+        psError(PS_ERR_UNKNOWN, false, "No sources with good PSF fits after model is built.");
         psFree(psfTry);
         return NULL;
@@ -643,5 +643,5 @@
         }
         if (entryMin == -1) {
-            psError (PS_ERR_UNKNOWN, true, "failed to find image map for shape params");
+            psError (PS_ERR_UNKNOWN, false, "failed to find image map for shape params");
             return false;
         }
@@ -958,13 +958,22 @@
     float dEsquare = 0.0;
     psStatsInit (stats);
-    psVectorStats (stats, e0res, NULL, mask, maskValue);
+    if (!psVectorStats (stats, e0res, NULL, mask, maskValue)) {
+	psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
+	return false;
+    }
     dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt));
 
     psStatsInit (stats);
-    psVectorStats (stats, e1res, NULL, mask, maskValue);
+    if (!psVectorStats (stats, e1res, NULL, mask, maskValue)) {
+	psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
+	return false;
+    }
     dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt));
 
     psStatsInit (stats);
-    psVectorStats (stats, e2res, NULL, mask, maskValue);
+    if (!psVectorStats (stats, e2res, NULL, mask, maskValue)) {
+	psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
+	return false;
+    }
     dEsquare += PS_SQR(psStatsGetValue(stats, stdevOpt));
 
@@ -1018,13 +1027,20 @@
         float dEsquare = 0.0;
         psStatsInit (statsS);
-        psVectorStats (statsS, dE0subset, NULL, mkSubset, 0xff);
+        if (!psVectorStats (statsS, dE0subset, NULL, mkSubset, 0xff)) {
+	}
         dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
 
         psStatsInit (statsS);
-        psVectorStats (statsS, dE1subset, NULL, mkSubset, 0xff);
-        dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
+        if (!psVectorStats (statsS, dE1subset, NULL, mkSubset, 0xff)) {
+	    psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
+	    return false;
+	}        
+	dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
 
         psStatsInit (statsS);
-        psVectorStats (statsS, dE2subset, NULL, mkSubset, 0xff);
+        if (!psVectorStats (statsS, dE2subset, NULL, mkSubset, 0xff)) {
+	    psError(PS_ERR_UNKNOWN, false, "failure to measure stats");
+	    return false;
+	}
         dEsquare += PS_SQR(psStatsGetValue(statsS, stdevOpt));
 
