Fix ConstraintType-related bugs.