Fixed errors in chi-squared calculation, now uses bin content instead of bin content/bin width