Index: trunk/psLib/src/imageops/psImageBackground.c
===================================================================
--- trunk/psLib/src/imageops/psImageBackground.c	(revision 9538)
+++ trunk/psLib/src/imageops/psImageBackground.c	(revision 9730)
@@ -36,5 +36,5 @@
     int Npixels = nx*ny;                // Total number of pixels
 
-    psVector *values = psVectorAlloc(Nsubset, PS_TYPE_F32); // Vector containing subsample
+    psVector *values = psVectorAllocEmpty(Nsubset, PS_TYPE_F32); // Vector containing subsample
 
     // Minimum and maximum values
Index: trunk/psLib/src/imageops/psImageConvolve.c
===================================================================
--- trunk/psLib/src/imageops/psImageConvolve.c	(revision 9538)
+++ trunk/psLib/src/imageops/psImageConvolve.c	(revision 9730)
@@ -5,6 +5,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.39 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-10-13 21:13:48 $
+ *  @version $Revision: 1.40 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:52:55 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -505,5 +505,4 @@
         /* generate normalized gaussian */ \
         psVector *gaussnorm = psVectorAlloc(Npixel, PS_TYPE_##TYPE); \
-        gaussnorm->n = gaussnorm->nalloc; \
         { \
             double sum = 0.0; \
@@ -522,5 +521,4 @@
         { \
             psVector *calculation = psVectorAlloc(Nx, PS_TYPE_##TYPE); \
-            calculation->n = calculation->nalloc; \
             for (int j = 0; j < Ny; j++) { \
                 ps##TYPE *vi = image->data.TYPE[j]; \
@@ -573,5 +571,4 @@
         /* Smooth in Y direction */ \
         psArray *rows = psArrayAlloc(Nrange); \
-        rows->n = Nrange; \
         /* Smooth the first Nrange pixels, with renorm */ \
         int yMax = PS_MIN(Nrange, Ny); \
@@ -579,5 +576,4 @@
         for (int j = 0; j < yMax; j++) { \
             psVector *calculation = psVectorAlloc(Nx, PS_TYPE_##TYPE); \
-            calculation->n = calculation->nalloc; \
             /* Zero the output row */ \
             memset(calculation->data.TYPE, 0, Nx*sizeof(ps##TYPE)); \
Index: trunk/psLib/src/imageops/psImageGeomManip.c
===================================================================
--- trunk/psLib/src/imageops/psImageGeomManip.c	(revision 9538)
+++ trunk/psLib/src/imageops/psImageGeomManip.c	(revision 9730)
@@ -10,6 +10,6 @@
  *  @author Ross Harman, MHPCC
  *
- *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-08 23:32:23 $
+ *  @version $Revision: 1.29 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:52:55 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -80,5 +80,5 @@
     }
 
-    vec = psVectorAlloc(scale * scale, in->type.type);
+    vec = psVectorAllocEmpty(scale * scale, in->type.type);
 
     if (mask != NULL) {
@@ -93,6 +93,5 @@
             return NULL;
         }
-        maskVec = psVectorAlloc(scale * scale, PS_TYPE_MASK);
-        maskVec->n = maskVec->nalloc;
+        maskVec = psVectorAllocEmpty(scale * scale, PS_TYPE_MASK);
         maskData = maskVec->data.PS_TYPE_MASK_DATA;
     }
@@ -134,4 +133,5 @@
                 } \
                 vec->n = n; \
+                maskVec->n = n; \
                 myStats = psVectorStats(myStats, vec, NULL, maskVec, maskVal); \
                 outRowData[col] = (ps##TYPE)psStatsGetValue(myStats, statistic); \
Index: trunk/psLib/src/imageops/psImagePixelExtract.c
===================================================================
--- trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 9538)
+++ trunk/psLib/src/imageops/psImagePixelExtract.c	(revision 9730)
@@ -8,6 +8,6 @@
  *  @author Robert DeSonia, MHPCC
  *
- *  @version $Revision: 1.27 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-26 04:34:28 $
+ *  @version $Revision: 1.28 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:52:55 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -18,4 +18,5 @@
 
 #include "psMemory.h"
+#include "psVector.h"
 #include "psImagePixelExtract.h"
 #include "psError.h"
@@ -392,5 +393,4 @@
     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;
@@ -417,5 +417,4 @@
         if (mask != NULL) {
             maskVec = psVectorAlloc(numRows, mask->type.type);
-            maskVec->n = maskVec->nalloc;
         }
         #define PSIMAGE_CUT_VERTICAL(TYPE) \
@@ -855,13 +854,11 @@
         // n.b. alloc enough for the data by making the vectors slightly larger
         // than the area of the region of interest.
-        buffer[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]),
-                                    input->type.type);
-        buffer[lcv]->n = 0;
+        buffer[lcv] = psVectorAllocEmpty(1+4*(rSq[lcv+1]-rSq[lcv]),
+                                         input->type.type);
 
         bufferMask[lcv] = NULL;
         if (mask != NULL) {
-            bufferMask[lcv] = psVectorAlloc(1+4*(rSq[lcv+1]-rSq[lcv]),
-                                            PS_TYPE_MASK);
-            bufferMask[lcv]->n = 0;
+            bufferMask[lcv] = psVectorAllocEmpty(1+4*(rSq[lcv+1]-rSq[lcv]),
+                                                 PS_TYPE_MASK);
         }
     }
Index: trunk/psLib/src/imageops/psImageStats.c
===================================================================
--- trunk/psLib/src/imageops/psImageStats.c	(revision 9538)
+++ trunk/psLib/src/imageops/psImageStats.c	(revision 9730)
@@ -9,6 +9,6 @@
  *  @author GLG, MHPCC
  *
- *  @version $Revision: 1.100 $ $Name: not supported by cvs2svn $
- *  @date $Date: 2006-08-26 04:34:28 $
+ *  @version $Revision: 1.101 $ $Name: not supported by cvs2svn $
+ *  @date $Date: 2006-10-24 22:52:55 $
  *
  *  Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii
@@ -76,5 +76,4 @@
 
         junkData = psVectorAlloc(numRows*numCols, in->type.type);
-        junkData->n = junkData->nalloc;
 
         psU8* data = junkData->data.U8;
@@ -100,5 +99,4 @@
 
             junkMask = psVectorAlloc(numRows*numCols, mask->type.type);
-            junkMask->n = junkMask->nalloc;
 
             psU8* data = junkMask->data.U8;
@@ -149,5 +147,4 @@
 
         junkData = psVectorAlloc(numRows*numCols, in->type.type);
-        junkData->n = junkData->nalloc;
 
         psU8* data = junkData->data.U8;
@@ -173,5 +170,4 @@
 
             junkMask = psVectorAlloc(numRows*numCols, mask->type.type);
-            junkMask->n = junkMask->nalloc;
 
             psU8* data = junkMask->data.U8;
@@ -592,9 +588,9 @@
         return -1;
     }/* else if (col0 == col1 && row0 == row1) {
-                                                psError(PS_ERR_BAD_PARAMETER_VALUE, true,
-                                                        "Invalid psRegion specified.  Region contains only 1 pixel.\n");
-                                                return -1;
-                                            }
-                                        */
+                                                    psError(PS_ERR_BAD_PARAMETER_VALUE, true,
+                                                            "Invalid psRegion specified.  Region contains only 1 pixel.\n");
+                                                    return -1;
+                                                }
+                                            */
     x0 = col0;
     x1 = col1;
