str decoding bug fixes