Fix `toString` and `copyEncoded` for qualified types.
Change `copyEncoded` interface.