Path handling fixes