Correctly handle pending buffers in all cases