Fix a bunch of planner error for in/exists queries