Update _max_height in prune function