Handle some exceptions when an operation is not well defined