Index: branches/simmosaic_branches/ppSim/src/ppSimLoadStars.c
===================================================================
--- branches/simmosaic_branches/ppSim/src/ppSimLoadStars.c	(revision 24860)
+++ branches/simmosaic_branches/ppSim/src/ppSimLoadStars.c	(revision 27839)
@@ -30,8 +30,9 @@
     psRegion *bounds = ppSimFPABounds (fpa);
     float radius = 0.5 * PS_MAX(bounds->x1 - bounds->x0, bounds->y1 - bounds->y0) * scale;
-    psFree(bounds);
 
     float x0fpa = 0.5*(bounds->x0 + bounds->x1);
     float y0fpa = 0.5*(bounds->y0 + bounds->y1);
+
+    psFree(bounds);
 
     psMetadataAdd(astroRecipe, PS_LIST_TAIL, "RA_MIN",  PS_DATA_F32 | PS_META_REPLACE, "",
@@ -41,5 +42,5 @@
     psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MIN", PS_DATA_F32 | PS_META_REPLACE, "", dec0 - radius);
     psMetadataAdd(astroRecipe, PS_LIST_TAIL, "DEC_MAX", PS_DATA_F32 | PS_META_REPLACE, "", dec0 + radius);
-    psArray *refStars = psastroLoadRefstars(config, "PSASTRO.INPUT");
+    psArray *refStars = psastroLoadRefstars(config, "PPSIM.OUTPUT");
     if (!refStars) {
         psError(PS_ERR_UNKNOWN, false, "Unable to find reference stars.");
