correctly handle invalid operations on streams (like writing on a non-writable one)
2 files changed