file: fix for read error checking