Fixed method to clean out URIs