[FOLD] streambuf fixes