More file closing - need to keep resources clean, especially for Windows