Replace iconv with iconv-lite
Fix close method