GI-204 Added clean up on error when reading files.