Add try/catch and test for malformed URIs.