Moved the write_stream_flags() call from io.c into main.c so that