TST: fixed do_copy testing
BUG: more encoding/decoding issues