Fixed some syntax errors in the Queries