Fix toString for pair sharing domain and remove spurious white spaces.