Make buffer size predictable on different archs
Add debug logs and a const to protect passed data
Add debug logs