Added output buffer tracking for line wrap.