Added limit back to getAncestors.