Make sure queries are correctly escaped