Fix constrain violation check