fix a bug in calculating HWE p. degree of freedom is not always 1.