Add some deferred file closing, because that's nice