Index: trunk/SophyaExt/XephemAstroLib/dbfmt.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/dbfmt.c	(revision 2646)
+++ trunk/SophyaExt/XephemAstroLib/dbfmt.c	(revision 2653)
@@ -387,5 +387,6 @@
 	if (nf < 5 || nf > 7) {
 	    if (whynot)
-		sprintf (whynot, "%s: f needs 5-7 fields, not %d",enm(flds),nf);
+		sprintf (whynot, "%s: type f needs 5-7 fields, not %d",
+								enm(flds),nf);
 	    return (-1);
 	}
@@ -411,5 +412,6 @@
 		return (-1);
 	    }
-	}
+	} else
+	    op->f_class = 'T';		/* default to star-like */
 	if (nsf > 2) {
 	    /* fill f_spect all the way */
@@ -465,5 +467,5 @@
 	if (nf != 13 && nf != 14) {
 	    if (whynot)
-		sprintf (whynot, "%s: e needs 13 or 14 fields, not %d",
+		sprintf (whynot, "%s: type e needs 13 or 14 fields, not %d",
 								enm(flds), nf);
 	    return (-1);
@@ -506,5 +508,5 @@
 	if (nf != 11 && nf != 12) {
 	    if (whynot)
-		sprintf (whynot, "%s: h needs 11 or 12 fields, not %d",
+		sprintf (whynot, "%s: type h needs 11 or 12 fields, not %d",
 								enm(flds), nf);
 	    return (-1);
@@ -536,5 +538,5 @@
 	if (nf != 10 && nf != 11) {
 	    if (whynot)
-		sprintf (whynot, "%s: p needs 10 or 11 fields, not %d",	
+		sprintf (whynot, "%s: type p needs 10 or 11 fields, not %d",	
 								enm(flds), nf);
 	    return (-1);
@@ -565,5 +567,5 @@
 	if (nf != 11 && nf != 12) {
 	    if (whynot)
-		sprintf (whynot, "%s: E needs 11 or 12 fields, not %d",
+		sprintf (whynot, "%s: type E needs 11 or 12 fields, not %d",
 							    enm(flds), nf);
 	    return (-1);
@@ -747,5 +749,5 @@
 	    if (whynot)
 		sprintf (whynot,
-			"%s: B needs 3,6 or 7 subfields in field 7, not %d",
+		       "%s: type B needs 3,6 or 7 subfields in field 7, not %d",
 								enm(flds), nsf);
 	    return (-1);
@@ -1004,3 +1006,3 @@
 
 /* For RCS Only -- Do Not Edit */
-static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: dbfmt.c,v $ $Date: 2005-01-17 10:13:04 $ $Revision: 1.4 $ $Name: not supported by cvs2svn $"};
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: dbfmt.c,v $ $Date: 2005-03-07 16:47:17 $ $Revision: 1.5 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/misc.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/misc.c	(revision 2646)
+++ trunk/SophyaExt/XephemAstroLib/misc.c	(revision 2653)
@@ -373,8 +373,12 @@
 	    return;
 
-	sA = sin(A);
-	y = sA*sb*sc;
-	x = cb - ca*cc;
-	B = y ? (x ? atan2(y,x) : (y>0 ? PI/2 : -PI/2)) : (x>=0 ? 0 : PI);
+	if (sc < 1e-7)
+	    B = cc < 0 ? A : PI-A;
+	else {
+	    sA = sin(A);
+	    y = sA*sb*sc;
+	    x = cb - ca*cc;
+	    B = y ? (x ? atan2(y,x) : (y>0 ? PI/2 : -PI/2)) : (x>=0 ? 0 : PI);
+	}
 
 	*Bp = B;
@@ -477,3 +481,3 @@
 
 /* For RCS Only -- Do Not Edit */
-static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: misc.c,v $ $Date: 2005-01-17 10:13:05 $ $Revision: 1.4 $ $Name: not supported by cvs2svn $"};
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: misc.c,v $ $Date: 2005-03-07 16:47:18 $ $Revision: 1.5 $ $Name: not supported by cvs2svn $"};
Index: trunk/SophyaExt/XephemAstroLib/moon.c
===================================================================
--- trunk/SophyaExt/XephemAstroLib/moon.c	(revision 2646)
+++ trunk/SophyaExt/XephemAstroLib/moon.c	(revision 2653)
@@ -101,4 +101,5 @@
 static double Args[NARGS];
 static double LP_equinox;
+static double NF_arcsec;
 static double Ea_arcsec;
 static double pA_precession;
@@ -2927,4 +2928,5 @@
 	      - 7.5311878482337989e-04) * T /* F, t^3 */
 	     - 1.3117809789650071e+01) * T2; /* F, t^2 */
+  NF_arcsec = x;
   Args[10] = x;
 
@@ -3463,3 +3465,3 @@
 
 /* For RCS Only -- Do Not Edit */
-static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: moon.c,v $ $Date: 2005-01-17 10:13:05 $ $Revision: 1.4 $ $Name: not supported by cvs2svn $"};
+static char *rcsid[2] = {(char *)rcsid, "@(#) $RCSfile: moon.c,v $ $Date: 2005-03-07 16:47:18 $ $Revision: 1.5 $ $Name: not supported by cvs2svn $"};
