Fix path parsing

Fix #10283.