 Complete the following phrase:  During the reigns of Muhammad IV 18591873 and Hassan I 18731894, the Alaouites tried to foster trade links, especially with European countries and the United States. The army and administration were also modernized to consolidate control over the Berber and Bedouin tribes. In 1859, Morocco went to war with Spain. The independence of Morocco was guaranteed at the Conference of Madrid in 1880, with France also gaining significant influence over Morocco. Germany attempted to counter the growing French influence, leading to the 