Adding guards for empty child lists in  get_all_children