Index: trunk/psLib/src/types/psArray.c
===================================================================
--- trunk/psLib/src/types/psArray.c	(revision 8814)
+++ trunk/psLib/src/types/psArray.c	(revision 8816)
@@ -9,6 +9,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.51 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-09-12 21:55:49 $
+ *  @version $Revision: 1.52 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-09-15 14:38:25 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -164,5 +164,5 @@
     PS_ASSERT_PTR_NON_NULL(array, false);
 
-    if (position > array->n) {
+    if (position < 0 || position >= array->n) {
         psError(PS_ERR_BAD_PARAMETER_NULL, true,
                 _("position > then the number of elements in the array."));
@@ -174,5 +174,5 @@
     psFree(array->data[i]);
     memmove(&array->data[i], &array->data[i + 1], (n - i - 1) * sizeof(psPtr));
-    array->n = --i; // reset the array size to indicate the removed item(s)
+    array->n--;    // reset the array size to indicate the removed item
 
     return true;
