Fix file detection.