Fix some small memory leaks.