Fixes to Query
Query Error Fixes