minor cleanup for handling poorly formed urls