Fix buffer sizing issue with streamReadBuffer
Fix some issues with streamReadBuffer