Adapt/fixed Yihui's proposal for str_bs