Fixing SQL syntax.