Fix case where fully empty subqueries create bad requests