Fixes depricated ->getParent() call.