Fixed incorrect buffer size in several places

Use correct sizes instead of sizeof(pointer)
Merge pull request #127 from Vbif/development

Fixed incorrect buffer size in several places