Index: /branches/rel10_ifa/psModules/src/astrom/pmConcepts.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmConcepts.c	(revision 6814)
+++ /branches/rel10_ifa/psModules/src/astrom/pmConcepts.c	(revision 6815)
@@ -434,10 +434,5 @@
             psFree(trimsec);
             pmConceptRegister(cellTrimsec, (pmConceptParseFunc)pmConceptParse_CELL_TRIMSEC,
-                              #if 0
-                              (pmConceptFormatFunc)pmConceptFormat_CELL_TRIMSEC,
-                              #else
-                              NULL,
-                              #endif
-                              PM_CONCEPT_LEVEL_CELL);
+                              (pmConceptFormatFunc)pmConceptFormat_CELL_TRIMSEC, PM_CONCEPT_LEVEL_CELL);
             psFree(cellTrimsec);
         }
Index: /branches/rel10_ifa/psModules/src/astrom/pmConceptsStandard.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmConceptsStandard.c	(revision 6814)
+++ /branches/rel10_ifa/psModules/src/astrom/pmConceptsStandard.c	(revision 6815)
@@ -434,5 +434,4 @@
 
 
-#if 0
 psMetadataItem *pmConceptFormat_CELL_TRIMSEC(psMetadataItem *concept, psMetadata *cameraFormat, pmFPA *fpa, pmChip *chip, pmCell *cell)
 {
@@ -446,5 +445,4 @@
     return formatted;
 }
-#endif
 
 psMetadataItem *pmConceptFormat_CELL_BIASSEC(psMetadataItem *concept, psMetadata *cameraFormat, pmFPA *fpa, pmChip *chip, pmCell *cell)
Index: /branches/rel10_ifa/psModules/src/astrom/pmConceptsStandard.h
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmConceptsStandard.h	(revision 6814)
+++ /branches/rel10_ifa/psModules/src/astrom/pmConceptsStandard.h	(revision 6815)
@@ -14,7 +14,5 @@
 psMetadataItem *pmConceptParse_CELL_TIME(psMetadataItem *concept, psMetadataItem *pattern, psMetadata *cameraFormat, pmFPA *fpa, pmChip *chip, pmCell *cell);
 psMetadataItem *pmConceptParse_CELL_Positions(psMetadataItem *concept, psMetadataItem *pattern, psMetadata *cameraFormat, pmFPA *fpa, pmChip *chip, pmCell *cell);
-#if 0
 psMetadataItem *pmConceptFormat_CELL_TRIMSEC(psMetadataItem *concept, psMetadata *cameraFormat, pmFPA *fpa, pmChip *chip, pmCell *cell);
-#endif
 psMetadataItem *pmConceptFormat_CELL_BIASSEC(psMetadataItem *concept, psMetadata *cameraFormat, pmFPA *fpa, pmChip *chip, pmCell *cell);
 psMetadataItem *pmConceptFormat_CELL_XBIN(psMetadataItem *concept, psMetadata *cameraFormat, pmFPA *fpa, pmChip *chip, pmCell *cell);
Index: /branches/rel10_ifa/psModules/src/astrom/pmConceptsWrite.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmConceptsWrite.c	(revision 6814)
+++ /branches/rel10_ifa/psModules/src/astrom/pmConceptsWrite.c	(revision 6815)
@@ -14,67 +14,133 @@
 //////////////////////////////////////////////////////////////////////////////////////////////////////////////
 
-static bool compareConcepts(psMetadataItem *item1, // First item to compare
-                            psMetadataItem *item2 // Second item to compare
+static bool compareConcepts(psMetadataItem *compare, // Item to compare
+                            psMetadataItem *standard // Standard for comparison
                            )
 {
     // First order checks
-    if (! item1 || ! item2) {
-        return false;
-    }
-    if (strcasecmp(item1->name, item2->name) != 0) {
+    if (! compare || ! standard) {
+        return false;
+    }
+    if (strcasecmp(compare->name, standard->name) != 0) {
         return false;
     }
 
     // Check the more boring types
-    switch (item1->type) {
+    switch (compare->type) {
     case PS_TYPE_S32:
-        switch (item2->type) {
+        switch (standard->type) {
         case PS_TYPE_S32:
-            psTrace(__func__, 10, "Comparing %d and %d...\n", item1->data.S32, item2->data.S32);
-            return (item1->data.S32 == item2->data.S32) ? true : false;
+            psTrace(__func__, 10, "Comparing %d and %d...\n", compare->data.S32, standard->data.S32);
+            return (compare->data.S32 == standard->data.S32) ? true : false;
         case PS_TYPE_F32:
-            psTrace(__func__, 10, "Comparing %d and %d...\n", item1->data.S32, (int)item2->data.F32);
-            return (item1->data.S32 == (int)item2->data.F32) ? true : false;
+            psTrace(__func__, 10, "Comparing %d and %d...\n", compare->data.S32, (int)standard->data.F32);
+            return (compare->data.S32 == (int)standard->data.F32) ? true : false;
         case PS_TYPE_F64:
-            psTrace(__func__, 10, "Comparing %d and %d...\n", item1->data.S32, (int)item2->data.F64);
-            return (item1->data.S32 == (int)item2->data.F64) ? true : false;
+            psTrace(__func__, 10, "Comparing %d and %d...\n", compare->data.S32, (int)standard->data.F64);
+            return (compare->data.S32 == (int)standard->data.F64) ? true : false;
         default:
             return false;
         }
     case PS_TYPE_F32:
-        switch (item2->type) {
+        switch (standard->type) {
         case PS_TYPE_S32:
-            psTrace(__func__, 10, "Comparing %f and %f...\n", item1->data.F32, (float)item2->data.S32);
-            return (item1->data.F32 == (float)item2->data.S32) ? true : false;
+            psTrace(__func__, 10, "Comparing %f and %f...\n", compare->data.F32, (float)standard->data.S32);
+            return (compare->data.F32 == (float)standard->data.S32) ? true : false;
         case PS_TYPE_F32:
-            psTrace(__func__, 10, "Comparing %f and %f...\n", item1->data.F32, item2->data.F32);
-            return (item1->data.F32 == item2->data.F32) ? true : false;
+            psTrace(__func__, 10, "Comparing %f and %f...\n", compare->data.F32, standard->data.F32);
+            return (compare->data.F32 == standard->data.F32) ? true : false;
         case PS_TYPE_F64:
-            psTrace(__func__, 10, "Comparing %f and %f...\n", item1->data.F32, (float)item2->data.F64);
-            return (item1->data.F32 == (float)item2->data.F64) ? true : false;
+            psTrace(__func__, 10, "Comparing %f and %f...\n", compare->data.F32, (float)standard->data.F64);
+            return (compare->data.F32 == (float)standard->data.F64) ? true : false;
         default:
             return false;
         }
     case PS_TYPE_F64:
-        switch (item2->type) {
+        switch (standard->type) {
         case PS_TYPE_S32:
-            psTrace(__func__, 10, "Comparing %f and %f...\n", item1->data.F32, (double)item2->data.S32);
-            return (item1->data.F64 == (double)item2->data.S32) ? true : false;
+            psTrace(__func__, 10, "Comparing %f and %f...\n", compare->data.F32, (double)standard->data.S32);
+            return (compare->data.F64 == (double)standard->data.S32) ? true : false;
         case PS_TYPE_F32:
-            psTrace(__func__, 10, "Comparing %f and %f...\n", item1->data.F32, (double)item2->data.F32);
-            return (item1->data.F64 == (double)item2->data.F32) ? true : false;
+            psTrace(__func__, 10, "Comparing %f and %f...\n", compare->data.F32, (double)standard->data.F32);
+            return (compare->data.F64 == (double)standard->data.F32) ? true : false;
         case PS_TYPE_F64:
-            psTrace(__func__, 10, "Comparing %f and %f...\n", item1->data.F32, item2->data.F64);
-            return (item1->data.F64 == item2->data.F64) ? true : false;
+            psTrace(__func__, 10, "Comparing %f and %f...\n", compare->data.F32, standard->data.F64);
+            return (compare->data.F64 == standard->data.F64) ? true : false;
         default:
             return false;
         }
-        return (item1->data.F64 == item2->data.F64) ? true : false;
+        return (compare->data.F64 == standard->data.F64) ? true : false;
     case PS_DATA_STRING:
-        if (item2->type != PS_DATA_STRING) {
+        if (standard->type != PS_DATA_STRING) {
             return false;
         }
-        psTrace(__func__, 10, "Comparing '%s' and '%s'\n", item1->data.V, item2->data.V);
-        return (strcasecmp(item1->data.V, item2->data.V) == 0) ? true : false;
+        psTrace(__func__, 10, "Comparing '%s' and '%s'\n", compare->data.V, standard->data.V);
+        return (strcasecmp(compare->data.V, standard->data.V) == 0) ? true : false;
+    case PS_DATA_LIST: {              // A list of strings
+            // "compare" contains a list of psMetadataItems
+            // "standard" likely contains just a string (but it might possibly be a list of strings)
+            psList *cList = compare->data.V; // The list from comparison item
+            psList *sList = NULL;         // The list from standard item
+            switch (standard->type) {
+            case PS_DATA_STRING:
+                sList = psStringSplit(standard->data.V, " ;");
+                break;
+            case PS_DATA_LIST:
+                sList = psMemIncrRefCounter(standard->data.V);
+                break;
+            default:
+                return false;
+            }
+            if (cList->n != sList->n) {
+                psFree(sList);
+                return false;
+            }
+            psVector *match = psVectorAlloc(cList->n, PS_TYPE_U8); // Array indicating which values match
+            psVectorInit(match, 0);
+            psListIterator *cIter = psListIteratorAlloc(cList, PS_LIST_HEAD, false); // compare iterator
+            psListIterator *sIter = psListIteratorAlloc(sList, PS_LIST_HEAD, false); // standard iterator
+            psMetadataItem *cItem = NULL; // Item from compare list
+            while ((cItem = psListGetAndIncrement(cIter))) {
+                if (cItem->type != PS_DATA_STRING) {
+                    psLogMsg(__func__, PS_LOG_WARN, "psMetadataItem from list is of type %x instead of "
+                             "%x (PS_DATA_STRING) --- can't interpret.\n", cItem->type, PS_DATA_STRING);
+                    psFree(cIter);
+                    psFree(sIter);
+                    psFree(match);
+                    psFree(sList);
+                    return false;
+                }
+                psString cString = cItem->data.V; // String from compare list
+                psListIteratorSet(sIter, PS_LIST_HEAD);
+                int index = 0;            // Index for list
+                bool found = false;       // Found a match?
+                for (psString sString = NULL; (sString = psListGetAndIncrement(sIter)) && !found; index++) {
+                    if (strcasecmp(cString, sString) == 0) {
+                        match->data.U8[index]++;
+                        found = true;
+                    }
+                }
+                if (! found) {
+                    // Can give up immediately
+                    psFree(cIter);
+                    psFree(sIter);
+                    psFree(match);
+                    psFree(sList);
+                    return false;
+                }
+            }
+            // Make sure we got 100% matches in both directions
+            bool allMatch = true;         // Did all of them match?
+            for (int i = 0; i < match->n && allMatch; i++) {
+                if (!match->data.U8[i]) {
+                    allMatch = false;
+                }
+            }
+            psFree(cIter);
+            psFree(sIter);
+            psFree(sList);
+            psFree(match);
+            return allMatch;
+        }
     default:
         return false;
@@ -82,4 +148,5 @@
     psAbort(__func__, "Should never get here.\n");
 }
+
 
 // Format a single concept
@@ -216,5 +283,5 @@
                     } else if (strcasecmp(source, "VALUE") == 0) {
                         psTrace(__func__, 8, "Checking %s against camera format.\n", name);
-                        if (! compareConcepts(cameraItem, formatted)) {
+                        if (! compareConcepts(formatted, cameraItem)) {
                             psLogMsg(__func__, PS_LOG_WARN, "Concept %s is specified by value in the camera "
                                      "format, but the values don't match.\n", name);
@@ -224,5 +291,5 @@
                                  "write\n", nameSource);
                     }
-                } else if (! compareConcepts(cameraItem, formatted)) {
+                } else if (! compareConcepts(formatted, cameraItem)) {
                     // Assume it's specified by value
                     psLogMsg(__func__, PS_LOG_WARN, "Concept %s is specified by value in the camera "
@@ -290,5 +357,5 @@
                     continue;
                 }
-                if (! compareConcepts(defaultItem, formatted)) {
+                if (! compareConcepts(formatted, defaultItem)) {
                     psLogMsg(__func__, PS_LOG_WARN, "Concept %s is specified by the DEFAULTS in the camera "
                              "format, but the values don't match.\n", name);
Index: /branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c	(revision 6814)
+++ /branches/rel10_ifa/psModules/src/astrom/pmFPAConstruct.c	(revision 6815)
@@ -579,4 +579,8 @@
             psTrace(__func__, 2, "---> NO PIXELS read in for extension %s\n", fpa->hdu->extname);
         }
+        if (fpa->hdu->header && header) {
+            psTrace(__func__, 2, "---> Header:\n");
+            psMetadataPrint(fpa->hdu->header, 8);
+        }
     }
     if (concepts) {
Index: /branches/rel10_ifa/psModules/src/astrom/pmHDU.c
===================================================================
--- /branches/rel10_ifa/psModules/src/astrom/pmHDU.c	(revision 6814)
+++ /branches/rel10_ifa/psModules/src/astrom/pmHDU.c	(revision 6815)
@@ -145,6 +145,13 @@
     }
 
-    if (!hdu->images && !psFitsWriteHeader(hdu->header, fits)) {
-        psError(PS_ERR_IO, false, "Unable to write header for extension %s\n", extname);
+    // Only a header
+    if (!hdu->images && !hdu->table) {
+        // Tell CFITSIO there's nothing there
+        psMetadataItem *naxis = psMetadataLookup(hdu->header, "NAXIS");
+        naxis->data.S32 = 0;
+
+        if (!psFitsWriteHeader(hdu->header, fits)) {
+            psError(PS_ERR_IO, false, "Unable to write header for extension %s\n", extname);
+        }
     }
 
