New test for inv_chi_square CDF
Fixed various bugs in CDF to pass unit-tests.