Fixes global leaks (?).