Fix tree state save

Ticket:	#4063