Changed ~str to StrBuf.