Fix `cleanup` global leak, Closes #475