Add output buffer handling