Fixed issue with incorrect buffer size