TreeCalc memleaks fixed and printed traversals