Variance calculations bug fixed