Fix file detection