Fix HistoryLocation rootURL handling and webkit workaround