struct for URI representation fixes

New branch, changes to pull request #2257