Improve handling of remote URLs.