Fix variable check to prevent warning on element_children.