adjust code to allow unit tests using really small write buffer sizes