fixed bug in chi2 calculation
Merge pull request #6937 from violatingcp/bugFixInChi2ForM2

fixed bug in chi2 calculation