Fix the lasts leaks. Valgrind is now happy, closes #25