Improve path generation for :root, yay expand_path