Avoid leaving open file resources | CAST Appmarq