Fixed minor inefficiency when getting URL path