Correctly deal with URLs that have a # in them.