Fixed SQL Queries.