Bug: getURLWithoutQueryAndHash wrong if url's ? and # in wrong order