Fixed gwd to return integer