Merge fix to always close files, with tweak.