Fix sql. Fix cleaning up.