Batch insert fix

When you doing a batch insert and the objects in the array had different set of keys the batch insert would take the keys from the first object.
Now it take all unique keys from all the objects and fills the missing values a NULL.