Index: trunk/psphot/src/psphot.h
===================================================================
--- trunk/psphot/src/psphot.h	(revision 36754)
+++ trunk/psphot/src/psphot.h	(revision 36757)
@@ -435,15 +435,5 @@
     float   NSigma;
     float   clampSN;
-#ifdef notdef
-    float fRmajorMin;
-    float fRmajorMax;
-    float fRmajorDel;
-    float fRminorMin;
-    float fRminorMax;
-    float fRminorDel;
-    float snMinAllTrials;
-    float reduceTrialsFactor;
-    bool  reducedTrials;
-#endif
+    int     extModelType;
 } psphotGalaxyShapeOptions;
 
Index: trunk/psphot/src/psphotGalaxyShape.c
===================================================================
--- trunk/psphot/src/psphotGalaxyShape.c	(revision 36754)
+++ trunk/psphot/src/psphotGalaxyShape.c	(revision 36757)
@@ -89,4 +89,10 @@
     opt->clampSN = psMetadataLookupF32(&status, recipe, "GALAXY_SHAPES_CLAMP_SN"); 
     psAssert (status, "missing GALAXY_SHAPES_NSIGMA");
+    psString modelTypeToSave = psMetadataLookupStr(&status, recipe, "EXT_MODEL_TYPE_FORCE");
+    if (modelTypeToSave && strcmp(modelTypeToSave, "ALL") && strcmp(modelTypeToSave, "BEST")) {
+        opt->extModelType = pmModelClassGetType(modelTypeToSave);
+    } else {
+        opt->extModelType = pmModelClassGetType("PS_MODEL_SERSIC");
+    }
 
 #ifdef notdef
@@ -251,4 +257,5 @@
 
         pmModelType modelType = model->type;
+        model->flags = PM_MODEL_STATUS_NONE;
 
         // we are using fitOptions->mode : be sure this makes sense
@@ -322,5 +329,5 @@
 
             // Replace modelEXT with the best model from the first of the model fits if one of them is good
-            if (isfinite(PAR[PM_PAR_I0]) && iModel == 0) {
+            if (isfinite(PAR[PM_PAR_I0]) && modelType == opt->extModelType) {
                 psFree (source->modelEXT);
 
