month, there was an incident when 17 of Guo Xi's soldiers, in a dispute with a wine seller, killed him and destroyed the winemaking equipment. Duan arrested them and beheaded them. Guo Xi's soldiers were incensed, armed themselves, and got ready to attack Bai's headquarters. Duan went to Guo Xi's headquarters with only one old man attending him. When he arrived there, the soldiers were surprised that he arrived effectively alone. Duan stated, "Why wear your armor for this old soldier? I brought my head with me." He then spoke to them: When Guo Xi came out of his tent to meet Duan, Duan rebuked him: Guo Xi was embarrassed and rebuked his soldiers, ordering them to stand down. That night, Duan stayed at Guo Xi's tent, and Guo Xi was up all night to protect him. The next day, Guo Xi, accompanied by Duan, visited Bai to apologize. Thereafter, the pillaging of Bin Prefecture ended. In 766, Ma Lin () replaced Bai as the military governor of Binning. Duan continued to serve as his deputy. It was said that whenever Ma made wrong decisions, Duan would argue with him about it and would not leave until Ma changed his mind. On one occasion, Ma became angry and threatened to kill Duan when Duan insisted, but Duan did not fear the threats, stating, "Why get angry about executing me if I deserve execution? If, on the other hand, I do not deserve execution, then you are unjust." Ma stormed out, but subsequently invited Duan to a feast to apologize. It was said that because of Duan's counsel, Ma received excellent reputation while governing Binning. Around the new year 769, at the suggestion of the chancellor Yuan Zai, the three prefectures belonging to Binning Circuit were merged into Guo Ziyi's command. Ma, along with his army, was moved to Jingyuan Circuit (涇原, headquartered in modern Pingliang, Gansu). Ma took part of the army to the capital of Jingyuan Circuit, Jing Prefecture, first, to rebuild the walls, while briefly having Duan remain at Bin Prefecture to oversee the troop movements. The soldiers under Ma's command were still largely soldiers who had come from Anxi in 756 to fight the Yan rebels and who had since been moved multiple locations. They were displeased about being moved once again, and the officer Wang Tongzhi () subsequently organized a plot to rise in mutiny. Duan