FIX bug (swapped args) in chi2

Added a non-regression test.