Fix file access issues