Use canonical file paths only for equivalence comparison.

Closes #1090.