Made processing file:// URIs a bit more robust