Index: trunk/psLib/src/math/psStats.c
===================================================================
--- trunk/psLib/src/math/psStats.c	(revision 3355)
+++ trunk/psLib/src/math/psStats.c	(revision 3374)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.117 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2005-03-01 22:21:34 $
+ *  @version $Revision: 1.118 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2005-03-04 20:51:20 $
  *
  *  Copyright 2004 Maui High Performance Computing Center, University of Hawaii
@@ -1006,4 +1006,6 @@
  
 XXX: Use static vectors for tmpMask.
+ 
+XXX: This has not been tested.
  *****************************************************************************/
 psS32 p_psVectorClippedStats(const psVector* myVector,
@@ -1016,5 +1018,5 @@
     psF32 clippedStdev = 0.0;   // self-explanatory
     psVector* tmpMask = NULL;   // Temporary vector for masks during iterations.
-    psStats *statsTmp = NULL;   // Temporary psStats struct.
+    static psStats *statsTmp = NULL;   // Temporary psStats struct.
     psS32 rc = 0;               // Return code.
 
@@ -1040,4 +1042,5 @@
     // However, we do no want to modify the original mask vector.
     tmpMask = psVectorAlloc(myVector->n, PS_TYPE_U8);
+    PS_VECTOR_SET_U8(tmpMask, 0);
 
     // If we were called with a mask vector, then initialize the temporary
@@ -1068,5 +1071,5 @@
 
     // 3. Use the sample median as the first estimator of the mean X.
-    clippedMean = statsTmp->sampleMean;
+    clippedMean = statsTmp->sampleMedian;
 
     // 4. Use the sample stdev as the first estimator of the mean stdev.
