Fixed the chi2 = 0 bug