Fix bugs in Constraints.