Emperor Jianwen
In 371, having lost a devastating battle to the Former Yan general Murong Chui in 369, the paramount general Huan Wen accused Emperor Fei of impotence and of not being the biological father of his sons. He then deposed him and made Sima Yu the new emperor (as Emperor Jianwen), although actual power was in Huan's hands. In 372, Emperor Jianwen grew ill and he named Sima Yao crown prince but in his will, he offered the throne to Huan, if he wanted it. When his official Wang Tanzhi () objected, Emperor Jianwen gave approval for an amendment, written by Wang, wherein Huan was only compared to the statesmen Zhuge Liang and Wang Dao. Nevertheless, when Emperor Jianwen died, many officials were apprehensive of Huan, and not immediately willing to declare Crown Prince Yao as the new emperor. Finally, at the instigation of Wang Biaozhi (), Crown Prince Yao took the throne as Emperor Xiaowu.