 Wei's contribution was in capturing the important city of Shouyang, and when Emperor Xuan's cousin Yuwen Liang (宇文亮) the Duke of Qi, angry and fearful that Emperor Xuan had recently raped his daughter-in-law Yuchi Chifan, tried to ambush Wei to seize his troops to further act against Emperor Xuan, Wei defeated Yuwen Liang.For these achievements, one of Wei's sons was created the Duke of Hua.In 580, Emperor Xuan died, and Emperor Xuan's father-in-law Yang Jian the Duke of Sui—the son-in-law of Wei's great friend Dugu Xin—became regent.