Fixed a wrong index loop assignment in fixFamilies.