Protocol-relative URLs for external files

And other small bugs