Check full path when doing path comparisons

Ticket: #4048