Small fix to zad2b, freeing tm structure at the end