Fixed orphan file detection