[fix] adds code that sets proper length of buffers
Merge pull request #107 from xively/fix-authorization

[fix] adds code that sets proper length of buffers