bugfix for lcm(0,0), add test coverage of gcd-related functions