Accessing invalid memory bug fix (bstring.c_str() after out of scope)