fixes bug where nullable values are not inserted in batch mode.

When inserting nullable values in batch mode, the column is always set to null. This pull request adds a test to demonstrate the problem, as well as a fix for the problem.