Fixes for I/O exception handling logic