Memory leak fixed by removing unused code.