Fix pesky in_array warning in relationship field

Fix in_array warnings in relationship field, by first checking to make sure the result_elements field is an array.