Fix: stuff output buffer size & pointer usage