Fix the lasts leaks. Valgrind is now happy, closes #25
Merge remote-tracking branch 'upstream/master'