Index: /branches/pap/psphot/src/psphotFake.c
===================================================================
--- /branches/pap/psphot/src/psphotFake.c	(revision 25261)
+++ /branches/pap/psphot/src/psphotFake.c	(revision 25262)
@@ -82,8 +82,8 @@
 
     psRandom *rng = psRandomAlloc(PS_RANDOM_TAUS); // Random number generator
-    for (int i = 0, index = 0; i <= numBins; i++) {
+    for (int i = 0, index = 0; i < numBins; i++) {
         float mag = refMag + magOffsets->data.F32[i]; // Instrumental magnitude of sources
 
-        for (int j = 0; j <= numSources; j++, index++) {
+        for (int j = 0; j < numSources; j++, index++) {
             xAll->data.F32[index] = psRandomUniform(rng) * numCols;
             yAll->data.F32[index] = psRandomUniform(rng) * numRows;
