Cleanup of io_error() and addition of runtime_error()