memory leaks: Memory leak cleanup patch by Corey Farrell (second set)