Fix file system interaction bug