Fixed so getParents doesn't loop outside inline root element.