Bad boolean test on constraints