Refine path expansion.