Index: /trunk/psLib/configure.ac
===================================================================
--- /trunk/psLib/configure.ac	(revision 7299)
+++ /trunk/psLib/configure.ac	(revision 7300)
@@ -172,5 +172,5 @@
 )
 dnl Now check if CFITSIO supports fits_open_diskfile, i.e., is at least version 2.501
-AC_CHECK_LIB(cfitsio,ffdkopen,
+AC_CHECK_LIB(cfitsio,ffdkopn,
   [CFITSIO_DISKFILE=1],
   [AC_MSG_WARN([The CFITSIO library version is rather old.  Suggested version is 2.501 or greater.])
@@ -361,8 +361,8 @@
 ])
 
-if test "$SWIG_REQ" == "yes"
-then
-  AC_CONFIG_FILES([ swig/Makefile ])
-fi
+#if test "$SWIG_REQ" == "yes"
+#then
+#  AC_CONFIG_FILES([ swig/Makefile ])
+#fi
 
 AC_OUTPUT
Index: /trunk/psLib/src/astro/psTime.c
===================================================================
--- /trunk/psLib/src/astro/psTime.c	(revision 7299)
+++ /trunk/psLib/src/astro/psTime.c	(revision 7300)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.82 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-03-07 04:20:10 $
+ *  @version $Revision: 1.83 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:33 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1757,7 +1757,9 @@
 static void psTimerFree ()
 {
-
-    psFree (timers);
     p_psTimeFinalize();
+    psFree(timers);
+    timers = NULL;
+    timerName[0] = '\0';
+
     return;
 }
Index: /trunk/psLib/src/fits/psFits.c
===================================================================
--- /trunk/psLib/src/fits/psFits.c	(revision 7299)
+++ /trunk/psLib/src/fits/psFits.c	(revision 7300)
@@ -7,10 +7,10 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.54 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-25 23:53:07 $
+ *  @version $Revision: 1.55 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:33 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
  */
-
+#include "config.h"
 #include <unistd.h>
 
@@ -54,5 +54,5 @@
             char fitsErr[MAX_STRING_LENGTH];
             fits_get_errstatus(status, fitsErr);
-            psError(PS_ERR_IO, true,
+            psError(PS_ERR_BAD_FITS, true,
                     "Error while closing psFits object. CFITSIO error: %s",
                     fitsErr);
Index: /trunk/psLib/src/fits/psFitsTable.c
===================================================================
--- /trunk/psLib/src/fits/psFitsTable.c	(revision 7299)
+++ /trunk/psLib/src/fits/psFitsTable.c	(revision 7300)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.10 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-27 02:01:23 $
+ *  @version $Revision: 1.11 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -909,4 +909,7 @@
 
     //create list of column names and types.
+    if (columns->n > 0) {  // If we're going decrement columns->n (why?), at least free the memory
+        psFree(columns->data[columns->n - 1]);
+    }
     columns->n--;
     psArray* columnNames = psArrayAlloc(columns->n);
Index: /trunk/psLib/src/math/psMinimizeLMM.c
===================================================================
--- /trunk/psLib/src/math/psMinimizeLMM.c	(revision 7299)
+++ /trunk/psLib/src/math/psMinimizeLMM.c	(revision 7300)
@@ -10,6 +10,6 @@
  *  @author EAM, IfA
  *
- *  @version $Revision: 1.14 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-10 00:49:38 $
+ *  @version $Revision: 1.15 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -115,4 +115,5 @@
 
     if (false == psMatrixGJSolve(Alpha, Beta)) {
+        psError(PS_ERR_UNKNOWN, false, "singular matrix in Guess ABP\n");
         psTrace (__func__, 4, "singular matrix in Guess ABP\n");
         return(false);
Index: /trunk/psLib/src/psErrorCodes_en.dat
===================================================================
--- /trunk/psLib/src/psErrorCodes_en.dat	(revision 7299)
+++ /trunk/psLib/src/psErrorCodes_en.dat	(revision 7300)
@@ -18,2 +18,3 @@
 UNEXPECTED_NULL                unexpected NULL found
 OS_CALL_FAILED                 unexpected result from an OS standard library call.
+BAD_FITS		       file doesn't obey FITS standard
Index: /trunk/psLib/src/sys/psError.c
===================================================================
--- /trunk/psLib/src/sys/psError.c	(revision 7299)
+++ /trunk/psLib/src/sys/psError.c	(revision 7300)
@@ -10,6 +10,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-31 19:53:36 $
+ *  @version $Revision: 1.30 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -167,4 +167,13 @@
 {
     return psErrorGet(0);
+}
+
+psErrorCode psErrorCodeLast(void)
+{
+    const psErr *err = psErrorGet(0);
+    psErrorCode code = err->code;
+    psFree(err);
+
+    return code;
 }
 
Index: /trunk/psLib/src/sys/psError.h
===================================================================
--- /trunk/psLib/src/sys/psError.h	(revision 7299)
+++ /trunk/psLib/src/sys/psError.h	(revision 7300)
@@ -12,6 +12,6 @@
  *  @author Eric Van Alst, MHPCC
  *
- *  @version $Revision: 1.25 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-07-15 02:33:54 $
+ *  @version $Revision: 1.26 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -63,4 +63,10 @@
 psErr* psErrorLast(void);
 
+/** Get errorCode of last error put on the error stack
+ *
+ *  @return psErrorCode     last error code, or PS_ERR_NONE
+ */
+psErrorCode psErrorCodeLast(void);
+
 /** Clears the error stack.
  *
Index: /trunk/psLib/src/sys/psLogMsg.c
===================================================================
--- /trunk/psLib/src/sys/psLogMsg.c	(revision 7299)
+++ /trunk/psLib/src/sys/psLogMsg.c	(revision 7300)
@@ -12,6 +12,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-20 02:43:53 $
+ *  @version $Revision: 1.53 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -310,4 +310,8 @@
         logDest = stderr;
     }
+    // If it's an abort, we always want to see the message
+    if (logDest == NULL && level == PS_LOG_ABORT) {
+        logDest = stderr;
+    }
     // If logging is off, or if the level is too high, return immediately.
     if ((level > globalLogLevel) || (logDest == NULL)) {
@@ -405,4 +409,8 @@
     } else {
         fputc('\n', logDest);
+    }
+
+    if (level == PS_LOG_ABORT) {
+        fflush(logDest);
     }
 }
Index: /trunk/psLib/src/sys/psString.h
===================================================================
--- /trunk/psLib/src/sys/psString.h	(revision 7299)
+++ /trunk/psLib/src/sys/psString.h	(revision 7300)
@@ -14,6 +14,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.20 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-01 00:57:07 $
+ *  @version $Revision: 1.21 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -29,4 +29,7 @@
 /** This macro will convert the argument to a quoted string */
 #define PS_STRING(S)  #S
+
+/** This macro expands to "file:line" */
+#define PS_FILE_LINE __FILE__ ":" PS_STRING(__LINE__)
 
 // Doxygen group tags
Index: /trunk/psLib/src/sys/psTrace.c
===================================================================
--- /trunk/psLib/src/sys/psTrace.c	(revision 7299)
+++ /trunk/psLib/src/sys/psTrace.c	(revision 7300)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.61 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-09-24 01:33:12 $
+ *  @version $Revision: 1.62 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -598,4 +598,8 @@
             vsprintf(line, format, ap);
             write (traceFD, line, strlen(line));
+            if (line[strlen(line) - 1] != '\n') {
+                write(traceFD, "\n", 1);
+            }
+
 
             //        vfprintf(traceFP, format, ap);
Index: /trunk/psLib/src/types/psArguments.c
===================================================================
--- /trunk/psLib/src/types/psArguments.c	(revision 7299)
+++ /trunk/psLib/src/types/psArguments.c	(revision 7300)
@@ -7,6 +7,6 @@
  *  @author David Robbins, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-05-25 03:51:33 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-06-02 21:33:34 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -96,4 +96,5 @@
             argv[i] = argv[i+1];
         }
+        argv[*argc] = NULL;
     } else {
         return false;
Index: /trunk/psLib/src/types/psMetadataConfig.c
===================================================================
--- /trunk/psLib/src/types/psMetadataConfig.c	(revision 7299)
+++ /trunk/psLib/src/types/psMetadataConfig.c	(revision 7300)
@@ -10,6 +10,6 @@
 *  @author Eric Van Alst, MHPCC
 *
-*  @version $Revision: 1.57 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-05-30 22:18:39 $
+*  @version $Revision: 1.58 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-06-02 21:33:34 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -1110,4 +1110,5 @@
 
     // While loop to parse the file
+    psErrorClear();   // so we can call psError(..., false, ...)
     while(fgets(line, MAX_STRING_LENGTH, fp) != NULL) {
 
@@ -1116,7 +1117,10 @@
         lineCount++;
 
-        if(!parseLine(&nestingLevel,parseLevelInfoArray,linePtr,lineCount,(char*)filename,overwrite) &&
-                nFail) {
-            (*nFail)++;
+        if(!parseLine(&nestingLevel,parseLevelInfoArray,linePtr,lineCount,(char*)filename,overwrite)) {
+            if (nFail != NULL) {
+                (*nFail)++;
+            } else {
+                psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Error parsing line: %s", linePtr);
+            }
         }
     }
