minor fix and update for bulk-insert 

This fixes a minor bug that only could by triggered by changing the logging options inside the bulk-insert code paths. The actual fix is to limit the maximum amount of hex-data logging, so it might affect other aspects of the code too. Since the checksum and logging code of the bulk-insert parth is quite old and maybe even obsolete, I took the opportunity to make it compile and work again.