Fix for incorrect (gcd -2) => -2; should give 2.