Fixed order of copying elements from ancestors to consider the nearest ancestor first.