Fixed a garbage collection bug where constraints were not cleaned up.