Added check for presence of children to $.children.