Moved child_num initialization into validation logic