fix Trees.getAncestors