Fixed a global variable leak.