Fix root() to ensure it retrieves root elements for all elements in the collection