Changed zeros in variance to 1 to avoid divide by zero errors in calibration