[buffer] Add missing code from previous commits