Merge "Fix a small bug where we could compute SharedBufferStack's tail incorrectly."