Squashed a bunch of memory leaks, again