Fixed a few obvious memory leaks.