Slightly improve URL parsing