Added a function fixFamilies that matches families to the nearest cell.