Changed isSameFile() to properly check providers