use warnings category IO
Changed exception messages
add tests