Fix assertion error with expression subqueries as conditions