Small memory optimization.
Merge pull request #46 from NightWhistler/buffer_optimization

Small memory optimization.