gcd bugfix