Don't close output file if we haven't opened it.