My chisq

Shall we merge this one? containing the little fixes we put in today?