Fixed issue

The initial problem states that if a item has a parent it cannot be a
root. Added in a check for the root object in case it has a parent to
ignore it as a root object.