Removed memory leaks.