Fix global var leak.