Index: trunk/pstamp/src/ppstampMakeStamp.c
===================================================================
--- trunk/pstamp/src/ppstampMakeStamp.c	(revision 34596)
+++ trunk/pstamp/src/ppstampMakeStamp.c	(revision 35497)
@@ -359,9 +359,11 @@
 
         if (options->writeCMF) {
-            pmReadout *astromReadout = NULL;
+            pmReadout *sourcesReadout = NULL;
             if (astrom->fpa != input->fpa) {
-                astromReadout = pmFPAviewThisReadout(srcView, astrom->fpa);
-            }
-            if (!copySources(outReadout, astromReadout, astromReadout, extractRegion)) {
+                sourcesReadout = pmFPAviewThisReadout(srcView, astrom->fpa);
+            } else {
+                sourcesReadout = readout;
+            }
+            if (!copySources(outReadout, sourcesReadout, sourcesReadout, extractRegion)) {
                 psError(PS_ERR_UNKNOWN, false, "failed to extract sources from region of interest.\n");
                 status = false;
@@ -784,4 +786,8 @@
 
     // first look for detections in the input readout. Those would have come from the -sources file
+    if (!inReadout->analysis) {
+        psLogMsg("ppstampMakeStamp", PS_LOG_WARN, "no analysis metadata found on input\n");
+        return false;
+    }
     pmDetections *inDetections = psMetadataLookupPtr (&status, inReadout->analysis, "PSPHOT.DETECTIONS");
     if (!inDetections) {
