Fix the computing of q = mod / p