Fix and add test for UriParser path logic.
Merge pull request #709 from lance/master

Fix and add test for UriParser path logic.