Fixed a crash in constraint removal