Fix a bunch of memory leaks. Two commented out because I can't figure out why they cause debug assertions. Good night! :)