Index: trunk/psModules/src/camera/pmFPACopy.c
===================================================================
--- trunk/psModules/src/camera/pmFPACopy.c	(revision 8842)
+++ trunk/psModules/src/camera/pmFPACopy.c	(revision 8848)
@@ -5,4 +5,5 @@
 #include <stdio.h>
 #include <assert.h>
+#include <string.h>
 
 #include <pslib.h>
Index: trunk/psModules/src/camera/pmFPAUtils.c
===================================================================
--- trunk/psModules/src/camera/pmFPAUtils.c	(revision 8842)
+++ trunk/psModules/src/camera/pmFPAUtils.c	(revision 8848)
@@ -4,4 +4,6 @@
 
 #include <stdio.h>
+#include <string.h>
+
 #include <pslib.h>
 #include "pmFPA.h"
Index: trunk/psModules/src/camera/pmFPA_JPEG.c
===================================================================
--- trunk/psModules/src/camera/pmFPA_JPEG.c	(revision 8842)
+++ trunk/psModules/src/camera/pmFPA_JPEG.c	(revision 8848)
@@ -5,6 +5,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.8 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-20 02:36:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -20,4 +20,6 @@
 /*****************************************************************************/
 
+#include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: trunk/psModules/src/camera/pmFPAfile.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfile.c	(revision 8842)
+++ trunk/psModules/src/camera/pmFPAfile.c	(revision 8848)
@@ -4,4 +4,5 @@
 
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: trunk/psModules/src/camera/pmFPAfileDefine.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 8842)
+++ trunk/psModules/src/camera/pmFPAfileDefine.c	(revision 8848)
@@ -4,4 +4,5 @@
 
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: trunk/psModules/src/camera/pmFPAfileIO.c
===================================================================
--- trunk/psModules/src/camera/pmFPAfileIO.c	(revision 8842)
+++ trunk/psModules/src/camera/pmFPAfileIO.c	(revision 8848)
@@ -4,4 +4,5 @@
 
 #include <stdio.h>
+#include <string.h>
 #include <pslib.h>
 
Index: trunk/psModules/src/camera/pmHDU.c
===================================================================
--- trunk/psModules/src/camera/pmHDU.c	(revision 8842)
+++ trunk/psModules/src/camera/pmHDU.c	(revision 8848)
@@ -5,4 +5,5 @@
 #include <stdio.h>
 #include <assert.h>
+#include <string.h>
 
 #include <pslib.h>
Index: trunk/psModules/src/camera/pmHDUGenerate.c
===================================================================
--- trunk/psModules/src/camera/pmHDUGenerate.c	(revision 8842)
+++ trunk/psModules/src/camera/pmHDUGenerate.c	(revision 8848)
@@ -5,4 +5,5 @@
 #include <stdio.h>
 #include <assert.h>
+#include <string.h>
 #include <pslib.h>
 
Index: trunk/psModules/src/concepts/pmConceptsRead.c
===================================================================
--- trunk/psModules/src/concepts/pmConceptsRead.c	(revision 8842)
+++ trunk/psModules/src/concepts/pmConceptsRead.c	(revision 8848)
@@ -5,4 +5,5 @@
 #include <stdio.h>
 #include <assert.h>
+#include <string.h>
 #include <pslib.h>
 
Index: trunk/psModules/src/concepts/pmConceptsStandard.c
===================================================================
--- trunk/psModules/src/concepts/pmConceptsStandard.c	(revision 8842)
+++ trunk/psModules/src/concepts/pmConceptsStandard.c	(revision 8848)
@@ -4,4 +4,5 @@
 
 #include <stdio.h>
+#include <string.h>
 #include <assert.h>
 
Index: trunk/psModules/src/concepts/pmConceptsWrite.c
===================================================================
--- trunk/psModules/src/concepts/pmConceptsWrite.c	(revision 8842)
+++ trunk/psModules/src/concepts/pmConceptsWrite.c	(revision 8848)
@@ -5,5 +5,5 @@
 #include <stdio.h>
 #include <assert.h>
-#include <strings.h>
+#include <string.h>
 #include <pslib.h>
 
@@ -132,13 +132,17 @@
 static bool writeSingleHeader(pmHDU *hdu, // HDU for which to add to the header
                               const char *keyword, // Keyword to add
-                              psMetadataItem *item // Item to add to the header
+                              psMetadataItem *item // Item to add to the header; may be NULL
                              )
 {
     assert(hdu);
     assert(keyword && strlen(keyword) > 0);
-    assert(item);
 
     if (!hdu->header) {
         hdu->header = psMetadataAlloc();
+    }
+    if (!item) {
+        psTrace("psModules.concepts", 9, "Writing header %s: <<<BLANK>>>\n", keyword);
+        // Assume it's a NULL string: it's most easily parsed.
+        return psMetadataAddStr(hdu->header, PS_LIST_TAIL, keyword, PS_META_REPLACE, NULL, NULL);
     }
     switch (item->type) {
@@ -188,18 +192,16 @@
     if (item->type == PS_DATA_LIST) {
         psList *values = item->data.V;  // List of outputs
-        if (values->n == 0) {
-            // Nothing to write
+        psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords
+        if (keys->n != values->n && values->n != 0) {
+            psError(PS_ERR_UNKNOWN, true, "Number of keywords (%ld) does not match number of "
+                    "values (%ld).\n", keys->n, values->n);
+            psFree(keys);
             return false;
-        }
-        psList *keys = psStringSplit(keywords, " ,;", true); // List of keywords
-        if (keys->n != values->n) {
-            psLogMsg(__func__, PS_LOG_WARN, "Number of keywords (%ld) does not match number of values (%ld).\n",
-                     keys->n, values->n);
         }
         psListIterator *keysIter = psListIteratorAlloc(keys, PS_LIST_HEAD, false); // Iterator for keywords
         psListIterator *valuesIter = psListIteratorAlloc(values, PS_LIST_HEAD, false); // Iterator for values
         psString key = NULL;            // Keyword from iteration
-        psMetadataItem *value = NULL;   // Value from iteration
-        while ((key = psListGetAndIncrement(keysIter)) && (value = psListGetAndIncrement(valuesIter))) {
+        while ((key = psListGetAndIncrement(keysIter))) {
+            psMetadataItem *value = psListGetAndIncrement(valuesIter); // Value from iteration; may be NULL
             status |= writeSingleHeader(hdu, key, value);
         }
@@ -394,28 +396,6 @@
                 continue;
             }
-            psList *keywords = psStringSplit(headerItem->data.V, " ,;", true); // List of header keywords
-            if (formatted->type == PS_DATA_LIST) {
-                psList *values = formatted->data.V; // The values for the headers
-                if (values->n != keywords->n) {
-                    psLogMsg(__func__, PS_LOG_WARN, "Number of headers specified does not match number "
-                             "of values for concept %s.\n", name);
-                }
-                psListIterator *valuesIter = psListIteratorAlloc(values, PS_LIST_HEAD, false); // Iterator
-                psListIterator *keywordsIter = psListIteratorAlloc(keywords, PS_LIST_HEAD, false);
-                psMetadataItem *valuesItem = NULL; // Item from list
-                while ((valuesItem = psListGetAndIncrement(valuesIter))) {
-                    psString keyword = psListGetAndIncrement(keywordsIter); // Keyword from the list
-                    if (strlen(keyword) > 0) {
-                        writeHeader(hdu, keyword, formatted);
-                    }
-                }
-                psFree(valuesIter);
-                psFree(keywordsIter);
-            } else {
-                psString keyword = psListGet(keywords, PS_LIST_HEAD); // The keyword
-                writeHeader(hdu, keyword, formatted);
-            }
+            writeHeader(hdu, headerItem->data.V, formatted);
             psFree(formatted);
-            psFree(keywords);
         }
     }
Index: trunk/psModules/src/detrend/pmDetrendDB.c
===================================================================
--- trunk/psModules/src/detrend/pmDetrendDB.c	(revision 8842)
+++ trunk/psModules/src/detrend/pmDetrendDB.c	(revision 8848)
@@ -3,7 +3,9 @@
 #endif
 
-# include <pslib.h>
-# include "pmFPA.h"
-# include "pmDetrendDB.h"
+#include <stdio.h>
+#include <string.h>
+#include <pslib.h>
+#include "pmFPA.h"
+#include "pmDetrendDB.h"
 
 // ************* detrend select functions **************
Index: trunk/psModules/src/detrend/pmFringeStats.c
===================================================================
--- trunk/psModules/src/detrend/pmFringeStats.c	(revision 8842)
+++ trunk/psModules/src/detrend/pmFringeStats.c	(revision 8848)
@@ -3,6 +3,6 @@
  *  @author Eugene Magnier, IfA
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-20 02:36:36 $
  *
  *  Copyright 2004 IfA
@@ -15,4 +15,5 @@
 #include <stdio.h>
 #include <assert.h>
+#include <string.h>
 #include <pslib.h>
 #include "pmFPA.h"
Index: trunk/psModules/src/detrend/psIOBuffer.c
===================================================================
--- trunk/psModules/src/detrend/psIOBuffer.c	(revision 8842)
+++ trunk/psModules/src/detrend/psIOBuffer.c	(revision 8848)
@@ -4,8 +4,10 @@
 #endif
 
-# include <unistd.h>
-# include <pslib.h>
-# include "pmFPA.h"
-# include "pmDetrendDB.h"
+#include <stdio.h>
+#include <string.h>
+#include <unistd.h>
+#include <pslib.h>
+#include "pmFPA.h"
+#include "pmDetrendDB.h"
 
 static void psIOBufferFree (psIOBuffer *buffer)
Index: trunk/psModules/src/detrend/psPipe.c
===================================================================
--- trunk/psModules/src/detrend/psPipe.c	(revision 8842)
+++ trunk/psModules/src/detrend/psPipe.c	(revision 8848)
@@ -3,10 +3,12 @@
 #endif
 
-# include <sys/types.h>
-# include <unistd.h>
-# include <fcntl.h>
-# include <pslib.h>
-# include "pmFPA.h"
-# include "pmDetrendDB.h"
+#include <stdio.h>
+#include <string.h>
+#include <sys/types.h>
+#include <unistd.h>
+#include <fcntl.h>
+#include <pslib.h>
+#include "pmFPA.h"
+#include "pmDetrendDB.h"
 
 void closePipes (int *stdin_fd, int *stdout_fd, int *stderr_fd)
Index: trunk/psModules/src/imcombine/pmReadoutCombine.c
===================================================================
--- trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 8842)
+++ trunk/psModules/src/imcombine/pmReadoutCombine.c	(revision 8848)
@@ -5,6 +5,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-15 09:49:01 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-20 02:36:36 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -17,4 +17,5 @@
 
 #include <stdio.h>
+#include <string.h>
 #include <assert.h>
 #include <pslib.h>
