Fixing SQL syntax error.