Rebase of 'file://' fix #1860 

Everything is outlined in #1860.

I just cherry-picked the change @radford made, but github can't automatically merge this against his branch, so he would have to merge manually yet again.