Fixed a bunch of memory leaks.
Finished feature 53698765/memory-leaks.