Fix file mode bug