bugfixes for Uri conversion