Fixed global leaks