Correct checksum management
Add file close to avoir IOException