Corrected an faulty SQL query.