Hacked in somewhat better url parsing.