Improve path comparison