Added hasParent method.