Fix file clearing