Eliminated all memory leaks, cache and allocation problems