Fix another INTERNAL ERROR

For rewriting equalities when they aren't equalities.
Fixes #695