buffer bugfix and test with large data
Merge pull request #2 from orsis/buffer_bugfix

Buffer bugfix