Fix for PROV-451 Exception when searching on "NOT" or "AND"