Correctly handle case where buffer is 100% full