Change some order in the barycenter calculation.