Functions gcd and lcm now always return a positive integer.