Fixed a leak of open files.