Fix bug in constraints