The elements of b_mat were being calculated incorrectly after herd was added and the TBV moved from column 8 to column 9. There was one other place where an alleged sort on TBV was really a sort on the generation an animal died.