Index: trunk/psModules/src/objects/pmSourceFitModel.c
===================================================================
--- trunk/psModules/src/objects/pmSourceFitModel.c	(revision 35560)
+++ trunk/psModules/src/objects/pmSourceFitModel.c	(revision 35768)
@@ -62,4 +62,8 @@
     opt->poissonErrors = true;
     opt->saveCovariance = false;
+
+    // we default to the old algorithm
+    opt->gainFactorMode = 0;
+    opt->chisqConvergence = true;
 
     return opt;
@@ -241,4 +245,6 @@
 
     psMinimization *myMin = psMinimizationAlloc (options->nIter, options->minTol, options->maxTol);
+    myMin->gainFactorMode = options->gainFactorMode;
+    myMin->chisqConvergence = options->chisqConvergence;
 
     psImage *covar = psImageAlloc (params->n, params->n, PS_TYPE_F32);
@@ -252,4 +258,5 @@
     }
     if (options->saveCovariance) {
+	psFree (model->covar);
 	model->covar = psMemIncrRefCounter(covar);
     }
@@ -273,5 +280,10 @@
     model->flags |= PM_MODEL_STATUS_FITTED;
     if (!fitStatus) model->flags |= PM_MODEL_STATUS_NONCONVERGE;
-    if (myMin->lastDelta > myMin->minTol) model->flags |= PM_MODEL_STATUS_WEAK_FIT;
+
+    if (myMin->chisqConvergence) {
+      if (myMin->lastDelta > myMin->minTol) model->flags |= PM_MODEL_STATUS_WEAK_FIT;
+    } else {
+      if (myMin->rParSigma > myMin->minTol*nParams) model->flags |= PM_MODEL_STATUS_WEAK_FIT;
+    }
 
     // get the Gauss-Newton distance for fixed model parameters
