Bugfix: Make sure the array key to retrieve the next generation is unique. Add the family xref to the key, because otherwise if there are more familes involved one key could overwrite the other.