Fixed #220 by adding error reporting to IO.