Fix handling of file:// protocol