Fixed double quoting in title SQL queries and removed debugging code