Index: trunk/psModules/src/camera/pmHDU.c
===================================================================
--- trunk/psModules/src/camera/pmHDU.c	(revision 11421)
+++ trunk/psModules/src/camera/pmHDU.c	(revision 11434)
@@ -8,4 +8,5 @@
 
 #include <pslib.h>
+#include "pmConfig.h"
 #include "pmFPA.h"
 
@@ -179,7 +180,17 @@
     }
 
+    // Make sure it's recognisable as what it's supposed to be
+    if (!hdu->header) {
+        hdu->header = psMetadataAlloc();
+    }
+    if (!pmConfigConformHeader(hdu->header, hdu->format)) {
+        psError(PS_ERR_UNKNOWN, false, "Unable to conform header to format.\n");
+        return false;
+    }
+
     // Only a header
     if (!images && !psFitsWriteBlank(fits, hdu->header, extname)) {
         psError(PS_ERR_IO, false, "Unable to write header for extension %s\n", extname);
+        return false;
     }
 
