Added stack buffer to avoid allocations.