Fix issue #2
Fix some issue with buffers