Put COMMIT statements in the proper place.