Improvements to make batch insert from python.