Hotfix: ExpandingBuffer.toByteArray omits last bytes if offset is not zero