Fix tree in case there are no nodes