Index: trunk/psphot/src/psphot.c
===================================================================
--- trunk/psphot/src/psphot.c	(revision 5643)
+++ trunk/psphot/src/psphot.c	(revision 5672)
@@ -11,4 +11,6 @@
     pmPSFClump   psfClump;
     bool         status;
+
+    psphotModelGroupInit ();
 
     config = psphotArguments (&argc, argv);
@@ -25,4 +27,7 @@
     // measure image stats for initial guess 
     sky = psphotImageStats (imdata, config);
+
+    // psPolynomial2D *skyModel = psphotImageBackground (imdata, config, sky);
+    psphotImageBackground (imdata, config, sky);
 
     // find the peaks in the image
@@ -53,4 +58,13 @@
 
     switch (FITMODE) {
+      case -2:
+	psphotEnsemblePSF (imdata, config, sources, psf, sky);
+	psphotReapplyPSF (imdata, config, sources, psf, sky);
+	break;
+
+      case -1:
+	psphotEnsemblePSF (imdata, config, sources, psf, sky);
+	break;
+
       case 0:
 	psphotFixedPSF (imdata, config, sources, psf, sky);
@@ -63,5 +77,5 @@
 
       case 2:
-      // fit extended objects with galaxy models
+	// fit extended objects with galaxy models
 	psphotApplyPSF (imdata, config, sources, psf, sky);
 	psphotFitGalaxies (imdata, config, sources, sky);
@@ -69,5 +83,5 @@
 
       case 3:
-      // fit extended objects with galaxy models
+	// fit extended objects with galaxy models
 	psphotFixedPSF (imdata, config, sources, psf, sky);
 	psphotFitGalaxies (imdata, config, sources, sky);
