bug fix and test for bulk loading