Fixes problem where predicates are evaluated wrongly in NOT