Fixed some buffer size issue