Fix path transformation bugs