Index: /branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/GetFileMode.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/GetFileMode.c	(revision 35001)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/GetFileMode.c	(revision 35002)
@@ -22,5 +22,17 @@
   if (havePHOT_VER && haveTARG_VER) return SDSS_OBJ;
 
-  if (haveNaxis && ((Naxis == 2) || TEXTMODE || !simple)) {
+  if (haveNaxis && (Naxis == 2)) {
+    int Nx, Ny;
+    gfits_scan (header, "NAXIS1",  "%d", 1, &Nx);
+    gfits_scan (header, "NAXIS2",  "%d", 1, &Ny);
+    if ((Nx > 0) && (Ny > 0)) {
+      if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) {
+	return MOSAIC_CMP;
+      }
+      return SIMPLE_CMP;
+    }
+  }
+
+  if (haveNaxis && (TEXTMODE || !simple)) {
     if (haveCTYPE && !strcmp (&ctype[4], "-WRP")) {
       return MOSAIC_CMP;
Index: /branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/mkcmf.c
===================================================================
--- /branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/mkcmf.c	(revision 35001)
+++ /branches/eam_branches/ipp-20121219/Ohana/src/addstar/src/mkcmf.c	(revision 35002)
@@ -313,8 +313,22 @@
   gfits_modify (ftable.header, "EXTNAME",   "%s", 1, "Chip.psf");
 
-  fits = fopen (argv[2], "w");
+  // open for append (if you want a new file, need to blow the old object)
+  fits = fopen (argv[2], "a+");
   if (fits == NULL) {
     fprintf (stderr, "ERROR: can't open output file %s\n", argv[2]);
     exit (1);
+  }
+
+  /* position to begining of file to write header */
+  off_t Nend = ftello (f);
+
+  /* if we are appending, fix up header */
+  if (Nend > 0) {
+    static char simple[] = "XTENSION= 'IMAGE  '            / Image extension";
+    int Ns, No;
+    Ns = strlen (simple);
+    No = 80 - Ns;
+    strncpy (header.buffer, simple, Ns);
+    memset (&header.buffer[Ns], ' ', No);
   }
 
