Fixed some problems in the disable constraints logic.