fix tests bugs, but still a problem with browser.location.url