Fix relationship indexing