Small changes to the error messages. Added a bit more I/O testing