Index: /trunk/psLib/src/imageops/psImagePixelExtract.c
===================================================================
--- /trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 7054)
+++ /trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 7055)
@@ -8,6 +8,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.18 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-04-06 22:55:18 $
+ *  @version $Revision: 1.19 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-03 23:16:16 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -474,4 +474,5 @@
     if (direction == PS_CUT_X_POS || direction == PS_CUT_X_NEG) {
         psVector* imgVec = psVectorAlloc(numRows, type);
+        imgVec->n = imgVec->nalloc;
         psVector* maskVec = NULL;
         psMaskType* maskData = NULL;
@@ -498,7 +499,6 @@
         if (mask != NULL) {
             maskVec = psVectorAlloc(numRows, mask->type.type);
-        }
-        imgVec->n = imgVec->nalloc;
-        maskVec->n = maskVec->nalloc;
+            maskVec->n = maskVec->nalloc;
+        }
         #define PSIMAGE_CUT_VERTICAL(TYPE) \
     case PS_TYPE_##TYPE: { \
Index: /trunk/psLib/src/math/psStats.c
===================================================================
--- /trunk/psLib/src/math/psStats.c	(revision 7054)
+++ /trunk/psLib/src/math/psStats.c	(revision 7055)
@@ -16,6 +16,6 @@
  * use ->min and ->max (PS_STAT_USE_RANGE)
  *
- *  @version $Revision: 1.170 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-02-24 23:43:15 $
+ *  @version $Revision: 1.171 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-05-03 23:16:16 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -617,4 +617,5 @@
                 PS_ERRORTEXT_psStats_STATS_SAMPLE_MEDIAN_SORT_PROBLEM);
         psTrace(__func__, 4, "---- %s(false) end ----\n", __func__);
+        psFree(unsortedVector);
         return(false);
     }
Index: /trunk/psLib/src/mathtypes/psVector.c
===================================================================
--- /trunk/psLib/src/mathtypes/psVector.c	(revision 7054)
+++ /trunk/psLib/src/mathtypes/psVector.c	(revision 7055)
@@ -9,6 +9,6 @@
 *  @author Robert DeSonia, MHPCC
 *
-*  @version $Revision: 1.71 $ $Name: not supported by cvs2svn $
-*  @date $Date: 2006-05-03 00:27:51 $
+*  @version $Revision: 1.72 $ $Name: not supported by cvs2svn $
+*  @date $Date: 2006-05-03 23:16:16 $
 *
 *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -389,10 +389,10 @@
     long N = outVector->n;                    // Number of elements
     if (N < 2) {
-        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                "Error in psVectorSort:  Vector has less than 2 data entries!\n");
-        psFree(outVector);
+        //        psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+        //                "Error in psVectorSort:  Vector has less than 2 data entries!\n");
+        //        psFree(outVector);
         //        psFree(outVector);
         //        outVector = NULL;
-        return NULL;
+        return outVector;
     }
     long l = N >> 1;
