Index: trunk/ppSim/src/ppSimMakeBias.c
===================================================================
--- trunk/ppSim/src/ppSimMakeBias.c	(revision 18011)
+++ trunk/ppSim/src/ppSimMakeBias.c	(revision 21365)
@@ -20,15 +20,15 @@
     float readnoise = psMetadataLookupF32(NULL, cell->concepts, "CELL.READNOISE");// CCD read noise, e
     if (isnan(readnoise)) {
-	psWarning("CELL.READNOISE is not set; reverting to recipe value READNOISE.");
-	readnoise = psMetadataLookupF32(&mdok, recipe, "READNOISE");
-	if (!mdok) {
-	    psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find READNOISE in recipe.");
-	    *status = false;
-	    return NULL;
-	}
+        psWarning("CELL.READNOISE is not set; reverting to recipe value READNOISE.");
+        readnoise = psMetadataLookupF32(&mdok, recipe, "READNOISE");
+        if (!mdok) {
+            psError(PS_ERR_BAD_PARAMETER_VALUE, false, "Unable to find READNOISE in recipe.");
+            *status = false;
+            return NULL;
+        }
     }
 
     psImage *signal = readout->image;
-    psImage *variance = readout->weight;
+    psImage *variance = readout->variance;
 
     int numRows = signal->numRows;
@@ -38,5 +38,5 @@
     psPolynomial1D *biasPoly = psPolynomial1DAlloc(PS_POLYNOMIAL_CHEB, biasOrder);
     for (int j = 0; j < biasOrder + 1; j++) {
-	biasPoly->coeff[j] = biasRange * psRandomGaussian(rng);
+        biasPoly->coeff[j] = biasRange * psRandomGaussian(rng);
     }
 
@@ -45,15 +45,15 @@
 
     for (int y = 0; y < numRows; y++) {
-	// Adjust bias level for this row
-	biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) /
-						  (float)numRows - 0.5) + biasLevel;
+        // Adjust bias level for this row
+        biasRows->data.F32[y] = psPolynomial1DEval(biasPoly, (float)(y + biasOffset) /
+                                                  (float)numRows - 0.5) + biasLevel;
 
-	for (int x = 0; x < numCols; x++) {
+        for (int x = 0; x < numCols; x++) {
 
-	    // Bias level
-	    signal->data.F32[y][x] += biasRows->data.F32[y];
-	    variance->data.F32[y][x] += PS_SQR(readnoise);
+            // Bias level
+            signal->data.F32[y][x] += biasRows->data.F32[y];
+            variance->data.F32[y][x] += PS_SQR(readnoise);
 
-	}
+        }
     }
     psFree(biasPoly);
