Fixed bug with resizing buffers