Fixing file read errors