Index: trunk/psModules/src/pslib/psSparse.c
===================================================================
--- trunk/psModules/src/pslib/psSparse.c	(revision 6872)
+++ trunk/psModules/src/pslib/psSparse.c	(revision 6943)
@@ -30,4 +30,6 @@
     sparse->Bfj = psVectorAlloc (Nrows, PS_DATA_F32);
     sparse->Qii = psVectorAlloc (Nrows, PS_DATA_F32);
+    sparse->Bfj->n = Nrows;
+    sparse->Qii->n = Nrows;
 
     sparse->Nrows = Nrows;
@@ -109,4 +111,5 @@
     if (output == NULL) {
         output = psVectorAlloc (vector->n, PS_DATA_F32);
+        output->n = vector->n;
     }
 
@@ -136,4 +139,5 @@
     // temporary storage for intermediate results
     psVector *dQ = psVectorAlloc (guess->n, PS_DATA_F32);
+    dQ->n = guess->n;
 
     for (int j = 0; j < Niter; j++) {
@@ -171,4 +175,6 @@
     psVector *tSi  = psVectorAlloc (Nelem, PS_DATA_S32);
     psVector *tSj  = psVectorAlloc (Nelem, PS_DATA_S32);
+    tAij->n = tSi->n = tSj->n = Nelem;
+
     for (int i = 0; i < Nelem; i++) {
         int j = index->data.U32[i];
@@ -213,5 +219,7 @@
     x->data.F32[1] = 5;
     x->data.F32[2] = 7;
-    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
+    x->n = 3;
+    fprintf (stderr, "x: %f %f %f\n", x->data.F32[0], x->data.F32[1], x->data.F32[2]);
+
 
     psVector *B = psSparseMatrixTimesVector (NULL, sparse, x);
