Revert modifications to `getParentAndGrandparent`