369 fix relation indexing

Closes #369