Fix file read / write