Fixed egcd return type