added NaN test for gamma_p
added NaN test for gamma_q