Fix for SQL query.