Fix handling of URI