Fix SET CONSTRAINTS ALL

Currently hits a NPE due to a missing else.

Add some more test cases to cover similar scenarios.