Made error in resource_from_uri more specific.