Extra check
Merge pull request #48 from NightWhistler/buffer_optimization

Bugfix on buffer optimization