Fixed a few non-consequential memory leaks.

Now valgrind spits fewer warnings, although there is still plenty to
go!