The fix looks good to me. The function $ezgcd, a function intended to be called from the top level, is surely used almost never. Maybe gcd with some gcd flag set to ezgcd would happen, but not this. RJF