Fixed exception checks while loading a file