Fixing SQL error.