Index: trunk/ppStack/src/ppStackPrepare.c
===================================================================
--- trunk/ppStack/src/ppStackPrepare.c	(revision 35529)
+++ trunk/ppStack/src/ppStackPrepare.c	(revision 35530)
@@ -355,59 +355,60 @@
 		 clipFWHMnSig,maxFWHM,threshFWHM,asymmetryFWHM);
       }
-      // Do GMM test with two modes to decide where to put the break.
-      double Punimodal;
-      int m = 2;
-      psVector *modes = psVectorAlloc(num,PS_TYPE_F32);
-      psVector *means = psVectorAlloc(m,PS_TYPE_F32);
-      psVector *S     = psVectorAlloc(m,PS_TYPE_F32);
-      psVector *pi    = psVectorAlloc(m,PS_TYPE_F32);
-      psImage *P      = psImageAlloc(m,num,PS_TYPE_F32);
-      
-      if (!psMM1DClass(options->inputSeeing,
-		       options->inputSeeing->n,
-		       modes,means,
-		       S,pi,P,
-		       2,
-		       &Punimodal)) {
-	// Handle error here
+      else {
+	// Do GMM test with two modes to decide where to put the break.
+	double Punimodal;
+	int m = 2;
+	psVector *modes = psVectorAlloc(num,PS_TYPE_F32);
+	psVector *means = psVectorAlloc(m,PS_TYPE_F32);
+	psVector *S     = psVectorAlloc(m,PS_TYPE_F32);
+	psVector *pi    = psVectorAlloc(m,PS_TYPE_F32);
+	psImage *P      = psImageAlloc(m,num,PS_TYPE_F32);
+	
+	if (!psMM1DClass(options->inputSeeing,
+			 options->inputSeeing->n,
+			 modes,means,
+			 S,pi,P,
+			 2,
+			 &Punimodal)) {
+	  // Handle error here
+	  psFree(modes);
+	  psFree(means);
+	  psFree(S);
+	  psFree(pi);
+	  psFree(P);
+	  return(false);
+	}
+	//    fprintf(stderr,"means: %g %g\n",means->data.F32[0],means->data.F32[1]);
+	//    fprintf(stderr,"sigma: %g %g \n",S->data.F32[0],S->data.F32[1]);
+	//    fprintf(stderr,"pi:    %g %g\n",pi->data.F32[0],pi->data.F32[1]);
+	
+	// Use Gaussian mixture model analysis of the FWHM distribution to decide an optional FWHM limit
+	if ((Punimodal > 0.5)|| // This distribution is best represented by a single mode
+	    (num <= 4)) {       // Or we have a small number of inputs, making this statistic poor.
+	  limit = maxFWHM;
+	}
+	else {                  // This is a bimodal distribution
+	  if ((fabs(pi->data.F32[0] - pi->data.F32[1]) < asymmetryFWHM)||  // However, both modes are equally populated
+	      (pi->data.F32[1] > pi->data.F32[0])) {                       // Or the larger FWHM mode is more populated
+	    limit = means->data.F32[1] + clipFWHMnSig * S->data.F32[1];
+	  }
+	  else {                                   // The smaller FWHM mode is more populated
+	    limit = means->data.F32[0] + clipFWHMnSig * S->data.F32[0];
+	  }
+	}
+	if (limit > maxFWHM)    { limit = maxFWHM; }    // We should not be larger than our max
+	if (limit < threshFWHM) { limit = threshFWHM; } // Nor smaller than our min
+	psLogMsg("ppStack",PS_LOG_INFO,
+		 "PSF FWHM distribution: limit: %f (%f %f %f) (%f %f %f) %f",
+		 limit,means->data.F32[0],S->data.F32[0],pi->data.F32[0],
+		 means->data.F32[1],S->data.F32[1],pi->data.F32[1],
+		 Punimodal);
+	psFree(means);
 	psFree(modes);
-	psFree(means);
 	psFree(S);
 	psFree(pi);
 	psFree(P);
-	return(false);
-      }
-      //    fprintf(stderr,"means: %g %g\n",means->data.F32[0],means->data.F32[1]);
-      //    fprintf(stderr,"sigma: %g %g \n",S->data.F32[0],S->data.F32[1]);
-      //    fprintf(stderr,"pi:    %g %g\n",pi->data.F32[0],pi->data.F32[1]);
-      
-      // Use Gaussian mixture model analysis of the FWHM distribution to decide an optional FWHM limit
-      if ((Punimodal > 0.5)|| // This distribution is best represented by a single mode
-	  (num <= 4)) {       // Or we have a small number of inputs, making this statistic poor.
-	limit = maxFWHM;
-      }
-      else {                  // This is a bimodal distribution
-	if ((fabs(pi->data.F32[0] - pi->data.F32[1]) < asymmetryFWHM)||  // However, both modes are equally populated
-	    (pi->data.F32[1] > pi->data.F32[0])) {                       // Or the larger FWHM mode is more populated
-	  limit = means->data.F32[1] + clipFWHMnSig * S->data.F32[1];
-	}
-	else {                                   // The smaller FWHM mode is more populated
-	  limit = means->data.F32[0] + clipFWHMnSig * S->data.F32[0];
-	}
-      }
-      if (limit > maxFWHM)    { limit = maxFWHM; }    // We should not be larger than our max
-      if (limit < threshFWHM) { limit = threshFWHM; } // Nor smaller than our min
-      psLogMsg("ppStack",PS_LOG_INFO,
-	       "PSF FWHM distribution: limit: %f (%f %f %f) (%f %f %f) %f",
-	       limit,means->data.F32[0],S->data.F32[0],pi->data.F32[0],
-	       means->data.F32[1],S->data.F32[1],pi->data.F32[1],
-	       Punimodal);
-      psFree(means);
-      psFree(modes);
-      psFree(S);
-      psFree(pi);
-      psFree(P);
-    } // End mixture model case
-
+      } // End mixture model case
+    }
     // Perform rejection using the limit set
     for (int i = 0; i < num; i++) {
