Fixed null error in first query. Fixed parsing error for IN subqueries