PAHMA-979: further mods: closing files explicitly.