Move header loop for relationship fields back into main function.