Corrected gcd