During the second half of the Northern Song dynasty, the influence of Shangqing Daoism declined at the court, but still remained, changing its focus to rituals and talismans. New buildings appeared on Maoshan that survived until the Cultural Revolution of Mao Zedong. Under the Song, some of the Shangqing leaders still benefited from imperial favour such as the 23rd leader, Zhu Ziying (974–1029), who received the title of ‘national master’ from the court. The 35th and 44th masters, Ren Yuanpu and Wang Daomeng, were equally distinguished for having ended a grasshopper invasion and a flood. Under the Yuan dynasty, the Shangqing school integrated itself under the Zhengyi alliance. At the end of the 20th century, the Taiping Rebellion, the Japanese army and the Cultural Revolution have resulted in the complete destruction of the temples on Maoshan. Two of the temples, Jiuxiaogong and Yuanfugong have been rebuilt more for tourists than for religious purposes.