Fix the constraint simplifier (Trac #7967)