Change error handling for file IO. Uses success flag to indicate if a file was read properly.