Fix retrieving transitive relations.