The close() method was removed in 882ad049986bbcaf1070f995d1c2f05b842ef3ac.

Fix close issues.