Index: trunk/stac/src/stacInvertMaps.c
===================================================================
--- trunk/stac/src/stacInvertMaps.c	(revision 6450)
+++ trunk/stac/src/stacInvertMaps.c	(revision 6887)
@@ -14,4 +14,5 @@
     int nMaps = maps->n;                // Number of maps
     psArray *inverted = psArrayAlloc(nMaps); // Array of inverted maps for output
+    inverted->n = nMaps;
 
     psTrace("stac.invertMaps", 1, "Inverting maps....\n");
@@ -45,4 +46,8 @@
         psVector *xOut = psVectorAlloc(NUM_GRID * NUM_GRID, PS_TYPE_F32);
         psVector *yOut = psVectorAlloc(NUM_GRID * NUM_GRID, PS_TYPE_F32);
+        xIn->n = NUM_GRID * NUM_GRID;
+        yIn->n = NUM_GRID * NUM_GRID;
+        xOut->n = NUM_GRID * NUM_GRID;
+        yOut->n = NUM_GRID * NUM_GRID;
 
         // Create grid of points
@@ -66,4 +71,6 @@
         psVector *xVector = psVectorAlloc(nCoeff, PS_TYPE_F64); // Vector for solution in x
         psVector *yVector = psVectorAlloc(nCoeff, PS_TYPE_F64); // Vector for solution in y
+        xVector->n = nCoeff;
+        yVector->n = nCoeff;
         for (int i = 0; i < nCoeff; i++) {
             for (int j = 0; j < nCoeff; j++) {
@@ -104,4 +111,5 @@
         // Solution via LU Decomposition
         psVector *permutation = psVectorAlloc(nCoeff, PS_TYPE_F64); // Permutation vector for LU Decomposition
+        permutation->n = nCoeff;
         psImage *luMatrix = psMatrixLUD(NULL, &permutation, matrix); // LU decomposed matrix
         psVector *xSolution = psMatrixLUSolve(NULL, luMatrix, xVector, permutation); // Solution in x
