Make path comparisons more robust