Index: trunk/psModules/src/objects/pmPSF_IO.c
===================================================================
--- trunk/psModules/src/objects/pmPSF_IO.c	(revision 40553)
+++ trunk/psModules/src/objects/pmPSF_IO.c	(revision 42129)
@@ -903,4 +903,9 @@
     // load the PSF model parameters from the FITS table
     char *modelName = psMetadataLookupStr (&status, header, "PSF_NAME");
+    if (!modelName) {
+        psError(PS_ERR_UNKNOWN, true, "missing model name in psf file %s", file->filename);
+        return false;
+    }
+
     options->type = pmModelClassGetType (modelName);
     if (options->type == -1) {
@@ -939,4 +944,9 @@
     // check the number of expected parameters
     int nPar = psMetadataLookupS32 (&status, header, "PSF_NPAR");
+    if (!status) {
+	psError(PS_ERR_UNKNOWN, true, "PSF file %s missing PSF_NPAR value", file->filename);
+	return false;
+    }
+
     if (nPar != pmModelClassParameterCount (psf->type))
         psAbort("mismatch model par count");
@@ -1051,5 +1061,13 @@
 
         int xBin  = psMetadataLookupS32 (&status, header, "XBIN");
+	if (!status) {
+            psError(psErrorCodeLast(), false, "XBIN not set in PSF residual image header.");
+            return false;
+        }
         int yBin  = psMetadataLookupS32 (&status, header, "YBIN");
+	if (!status) {
+            psError(psErrorCodeLast(), false, "YBIN not set in PSF residual image header.");
+            return false;
+        }
 
         int xSize = Nx / xBin;
