Memory leaks removed.