Improve error handling for reading (ref #9)