Leak fixes

Another few fixes for leaks found by Bishwa's valgrind runs.