#52 fix open flags processing for output streams
#52 fix open flags processing for output streams