Fix bug in calculation of q/p old.