Fixed small bug in tree simplifier.