Improved URL handling and other fixes

this isn't a prefix  O_o