Index: trunk/psModules/src/objects/pmSourceGroups.c
===================================================================
--- trunk/psModules/src/objects/pmSourceGroups.c	(revision 26162)
+++ trunk/psModules/src/objects/pmSourceGroups.c	(revision 26172)
@@ -63,23 +63,19 @@
     int nCells = nThreads * 2*2;        // number of cells in a single set
     int C = sqrt(nCells) + 0.5;
-    int Cx, Cy;                         // Number of cells in x and y
+    int Cx = 1, Cy = 1;                 // Number of cells in x and y
 
     // we need to assign Cx and Cy based on the dimensionality of the image
     // crude way to find most evenly balanced factors of nCells:
-    if (C <= 1) {
-        Cx = Cy = 1;
-    } else {
-        for (int i = C; i >= 1; i--) {
-            int C1 = nCells / C;
-            int C2 = nCells / C1;
-            if (C1*C2 != nCells) continue;
+    for (int i = C; i >= 1; i--) {
+        int C1 = nCells / C;
+        int C2 = nCells / C1;
+        if (C1*C2 != nCells) continue;
 
-            if (readout->image->numRows > readout->image->numCols) {
-                Cx = PS_MAX(C1, C2);
-                Cy = PS_MIN(C1, C2);
-            } else {
-                Cx = PS_MAX(C1, C2);
-                Cy = PS_MIN(C1, C2);
-            }
+        if (readout->image->numRows > readout->image->numCols) {
+            Cx = PS_MAX(C1, C2);
+            Cy = PS_MIN(C1, C2);
+        } else {
+            Cx = PS_MAX(C1, C2);
+            Cy = PS_MIN(C1, C2);
         }
     }
