Output files are now closed when they are done being written.