Updated buffer handling