Fixes a global variable leak