Fix undefined index 'children'