Index: trunk/psLib/src/dataIO/psFileUtilsErrors.dat
===================================================================
--- trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 2962)
+++ trunk/psLib/src/dataIO/psFileUtilsErrors.dat	(revision 2965)
@@ -21,5 +21,6 @@
 psFits_EXTNAME_NULL                    Specified extension name can not be NULL.
 psFits_EXTNAME_INVALID                 Could not find HDU '%s' in file %s.\nCFITSIO Error: %s
-psFits_EXTNUM_INVALID                  Could not find HDU #%d in file %s.\nCFITSIO Error: %s
+psFits_EXTNUM_ABS_MOVE_FAILED          Could not move to specified HDU #%d in file %s.\nCFITSIO Error: %s
+psFits_EXTNUM_REL_MOVE_FAILED          Could not move %d HDUs from current position in file %s.\nCFITSIO Error: %s
 psFits_GET_EXTNUM_FAILED               Failed to determine the current HDU number in file %s.\nCFITSIO Error: %s
 psFits_GETNUMHDUS_FAILED               Failed to determine the number of HDUs in file %s.\nCFITSIO Error: %s
Index: trunk/psLib/src/dataIO/psFileUtilsErrors.h
===================================================================
--- trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 2962)
+++ trunk/psLib/src/dataIO/psFileUtilsErrors.h	(revision 2965)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.6 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-12 22:17:01 $
+ *  @version $Revision: 1.7 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-13 01:54:25 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -43,5 +43,6 @@
 #define PS_ERRORTEXT_psFits_EXTNAME_NULL "Specified extension name can not be NULL."
 #define PS_ERRORTEXT_psFits_EXTNAME_INVALID "Could not find HDU '%s' in file %s.\nCFITSIO Error: %s"
-#define PS_ERRORTEXT_psFits_EXTNUM_INVALID "Could not find HDU #%d in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_EXTNUM_ABS_MOVE_FAILED "Could not move to specified HDU #%d in file %s.\nCFITSIO Error: %s"
+#define PS_ERRORTEXT_psFits_EXTNUM_REL_MOVE_FAILED "Could not move %d HDUs from current position in file %s.\nCFITSIO Error: %s"
 #define PS_ERRORTEXT_psFits_GET_EXTNUM_FAILED "Failed to determine the current HDU number in file %s.\nCFITSIO Error: %s"
 #define PS_ERRORTEXT_psFits_GETNUMHDUS_FAILED "Failed to determine the number of HDUs in file %s.\nCFITSIO Error: %s"
Index: trunk/psLib/src/dataIO/psFits.c
===================================================================
--- trunk/psLib/src/dataIO/psFits.c	(revision 2962)
+++ trunk/psLib/src/dataIO/psFits.c	(revision 2965)
@@ -7,6 +7,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.4 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-01-12 22:17:01 $
+ *  @version $Revision: 1.5 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-01-13 01:54:25 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -287,16 +287,23 @@
 
     if (relative) {
-        fits_movrel_hdu(fits->p_fd, extnum+1, &hdutype, &status);
+        fits_movrel_hdu(fits->p_fd, extnum, &hdutype, &status);
+        if (status != 0) {
+            char fitsErr[MAX_STRING_LENGTH];
+            fits_get_errstatus(status, fitsErr);
+            psError(PS_ERR_LOCATION_INVALID, true,
+                    PS_ERRORTEXT_psFits_EXTNUM_REL_MOVE_FAILED,
+                    extnum, fits->filename, fitsErr);
+            return false;
+        }
     } else {
         fits_movabs_hdu(fits->p_fd, extnum+1, &hdutype, &status);
-    }
-
-    if (status != 0) {
-        char fitsErr[MAX_STRING_LENGTH];
-        fits_get_errstatus(status, fitsErr);
-        psError(PS_ERR_LOCATION_INVALID, true,
-                PS_ERRORTEXT_psFits_EXTNUM_INVALID,
-                extnum, fits->filename, fitsErr);
-        return false;
+        if (status != 0) {
+            char fitsErr[MAX_STRING_LENGTH];
+            fits_get_errstatus(status, fitsErr);
+            psError(PS_ERR_LOCATION_INVALID, true,
+                    PS_ERRORTEXT_psFits_EXTNUM_ABS_MOVE_FAILED,
+                    extnum, fits->filename, fitsErr);
+            return false;
+        }
     }
 
