Fix path extraction