Simulate file handles being kept open
Fix file handle reopening