In invMod2, raising an error if the inverse was not found.