Fix various potential problems around URLs