Fix a couple of memory leaks pointed out by Adam Bernstein.