Working write when the buffer wraps around now