Major fix to memory leaks. Hurray this is 99% of all leaks.