Index: branches/simmosaic_branches/ppSim/src/ppSimLoop.c
===================================================================
--- branches/simmosaic_branches/ppSim/src/ppSimLoop.c	(revision 24860)
+++ branches/simmosaic_branches/ppSim/src/ppSimLoop.c	(revision 27839)
@@ -30,4 +30,9 @@
     ppSimType type = ppSimTypeFromString (typeStr); // Type of image to simulate
     int binning = psMetadataLookupS32(NULL, recipe, "BINNING"); // Binning in x and y
+
+    ppSimUpdateConceptsFPA (fpa, config);
+    if (fpa->hdu) { // XXX only do this if there is no INPUT image
+        if (!ppSimInitHeader(config, fpa, NULL, NULL)) ESCAPE (PS_ERR_UNKNOWN, "problem setting output header");
+    }
 
     psArray *stars = psArrayAllocEmpty (1);
@@ -43,4 +48,7 @@
         if (!ppSimMakeStars (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars");
 
+        // Add random stars
+        if (!ppSimMakeStarGrid (stars, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random stars");
+
         // Add random galaxies
         if (!ppSimMakeGalaxies (galaxies, fpa, config, rng)) ESCAPE (PS_ERR_UNKNOWN, "failed to make random galaxies");
@@ -57,9 +65,4 @@
         psFree(view);
         return false;
-    }
-
-    ppSimUpdateConceptsFPA (fpa, config);
-    if (fpa->hdu) { // XXX only do this if there is no INPUT image
-        if (!ppSimInitHeader(config, fpa, NULL, NULL)) ESCAPE (PS_ERR_UNKNOWN, "problem setting output header");
     }
 
