Remove redundancy, fix bug with closing popped file handle
2 files changed