Fix global leaks

that's all.