Change formatPath api to avoid :port clashes