Fixing unclosed file resource.