Fixed the malformed SQL.