Improved the urlName function.