Refactored the io_err stuff.