Fixed a whole bunch of memory leaks, some remain