I think one text/translation refers to "except by immorality".

By the way, divorce was also not considered "an undoing" of a marriage but rather in a sense a public penalty box, to be "given a bill of divorce"....that is a last means of bringing someone to their senses, not unlike the purpose of "excommunication".