Fixed collapsePaths