Fixed the missing call to `do_cleanup`