Fix sql for inserts.