Better type checking for some predicates