Fixed quoting for subqueries