Index: trunk/psLib/src/xml/psXML.c
===================================================================
--- trunk/psLib/src/xml/psXML.c	(revision 1986)
+++ trunk/psLib/src/xml/psXML.c	(revision 1995)
@@ -9,6 +9,6 @@
 *  @author Ross Harman, MHPCC
 *
-*  @version $Revision: 1.2 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2004-10-06 22:51:15 $
+*  @version $Revision: 1.3 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2004-10-07 02:16:36 $
 *
 *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -36,15 +36,16 @@
 
 /** Check for FITS errors */
-#define FITS_ERROR(STRING,PS_ERROR)                                                                          \
-fits_get_errstatus(status, fitsErr);                                                                         \
-psError(__func__, STRING, PS_ERROR, fitsErr);                                                                \
-status = 0;                                                                                                  \
-fits_close_file(fd, &status);                                                                                \
-if(status){                                                                                                  \
-    fits_get_errstatus(status, fitsErr);                                                                     \
-    psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr);                                  \
-}                                                                                                            \
-status = 0;                                                                                                  \
-return output;
+#define FITS_ERROR(STRING,PS_ERROR) \
+fits_get_errstatus(status, fitsErr); \
+psError(__func__, STRING, PS_ERROR, fitsErr); \
+status = 0; \
+fits_close_file(fd, &status); \
+if(status){ \
+    fits_get_errstatus(status, fitsErr); \
+    psError(__func__, "Couldn't close FITS file. FITS error: %s", fitsErr); \
+} \
+status = 0; \
+psFree(output); \
+return NULL;
 
 /** Free and null temporary variables used by config file parser */
@@ -372,6 +373,6 @@
         psError(__func__, "Null extName and extNum = 0 not allowed");
         return NULL;
-    } else if (extName && extNum) {
-        psError(__func__, "Both extName and extNum arguments should not have non zero values.");
+    } else if (extName && (extNum != -1) ) {
+        psError(__func__, "If extName specified, extNum arguments should be -1.");
         return NULL;
     }
