Implement conflict resolution also in get_masses().