Adding a restriction on the number of rows inserted in a single batch.

Fixes #974