Index: trunk/psastro/src/psastroLoadRefstars.c
===================================================================
--- trunk/psastro/src/psastroLoadRefstars.c	(revision 12794)
+++ trunk/psastro/src/psastroLoadRefstars.c	(revision 12806)
@@ -1,3 +1,3 @@
-# include "psastro.h"
+# include "psastroInternal.h"
 # define ELIXIR_MODE 1
 
@@ -22,5 +22,5 @@
     PS_ASSERT (CATDIR, NULL);
 
-    char *getstarCommand = psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR");
+    char *getstarCommand = psMemIncrRefCounter(psMetadataLookupStr(NULL, recipe, "DVO.GETSTAR"));
     PS_ASSERT (getstarCommand, NULL);
 
@@ -44,8 +44,8 @@
     }
 
-    // XXX check for a default name (use .ptolemyrc)?
-    if (CATDIR) {
+    // check for default name (use .ptolemyrc), or use specified CATDIR
+    if (strcasecmp(CATDIR, "NONE")) {
         psStringAppend (&getstarCommand, " -D CATDIR %s", CATDIR);
-    }
+    } 
 
     // psStringAppend (&getstarCommand, " -D CATMODE mef -maglim %f -region %f %f %f %f -o %s", MAGmax, RAmin, DECmin, RAmax, DECmax, tempFile);
@@ -89,4 +89,5 @@
     // convert the Average table to the pmAstromObj entries
     psTimerStart ("psastro");
+
     psArray *refstars = psArrayAllocEmpty (table->n);
     for (int i = 0; i < table->n; i++) {
