Fix path handling bug on Windows #1544