Adding unit test coverage to the URI parser and tweaking its logic a bit.