Fix io for buffer in unit tests