Fixed bug in bulk_insert.