Allow joining to the civicrm_relationship table via either contact_id_a or contact_id_b; remove implicit contact_id_a join.