fixing some issues pointing out by Code Analysis.
fixed Insert batch to be in accordance with DRIVERS-2 and match up to master.