Fix leaked globals (thanks Gethe).