Remove unused, fix global leak