Merge pull request #2 from hpence/develop

Cleaned up a utility function
Some Uri parsing error handling in place
more error handling