Fix to ensure that bidirectional relationships are detected based on types and not names only.