fix _do_close
more coverage