Index: branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsUtils.c
===================================================================
--- branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsUtils.c	(revision 27884)
+++ branches/eam_branches/psphot.20100506/src/psphotStackMatchPSFsUtils.c	(revision 27888)
@@ -45,4 +45,5 @@
 }
 
+# define SN_MIN 50.0
 psArray *stackSourcesFilter(psArray *sources, // Source list to filter
 			    int exclusion // Exclusion zone, pixels
@@ -62,4 +63,6 @@
             continue;
         }
+	if (!source->peak) continue;
+	if (source->peak->SN < SN_MIN) continue;
         coordsFromSource(&x->data.F32[numGood], &y->data.F32[numGood], source);
         numGood++;
@@ -77,4 +80,6 @@
             continue;
         }
+	if (!source->peak) continue;
+	if (source->peak->SN < SN_MIN) continue;
         float xSource, ySource;         // Coordinates of source
         coordsFromSource(&xSource, &ySource, source);
@@ -325,5 +330,5 @@
 
     // These values are specified specifically for stacking
-    const char *stampsName = psMetadataLookupStr(NULL, config->arguments, "STAMPS");// Stamps filename
+    const char *stampsName = psMetadataLookupStr(&mdok, config->arguments, "STAMPS");// Stamps filename
 
     psVector *widthsCopy = NULL;
