Improved URL handling and other fixes

It snuck in anyway :)