the civil war era the unclear succession laws and the practice of power-sharing between several kings simultaneously gave personal conflicts the potential to become full-blown wars. Over the centuries kings consolidated their power and eventually a strict succession law made Norway a principally hereditary kingdom. As a result of the unions with Denmark and Sweden, the heredity principles were several times flouted in the succession to the throne, until they were explicitly abolished in 1450. Unions with Denmark and Sweden After the extinction of the male lines of the perceived Fairhair dynasty in 1319, the throne of Norway passed through matrilineal descent to Magnus VII, who in the same year became elected as king of Sweden too. In 1343 Magnus had to abdicate as King of Norway in favour of his younger son, Haakon VI of Norway. The oldest son, Eric, was explicitly removed from the future line of succession of Norway. Traditionally Norwegian historians have interpreted this clear break with previous successions as stemming from dissatisfaction among the Norwegian nobility with Norway's junior position in the union. However it may also be the result of Magnus' dynastic policies. He had two sons and two kingdoms and might have wished they should inherit one each, rather than start battling over the inheritance. Magnus was at the same time attempting to secure Eric's future election as King of Sweden. The Black Death of 1349–1351 was a contributing factor to the decline of the Norwegian monarchy as the noble families and population in general were gravely affected. But the most devastating factor for the nobility and the monarchy in Norway was the steep decline in income from their holdings. Many farms were deserted and rents and taxes suffered. This left the Norwegian monarchy weakened in terms of manpower, noble support, defence ability and economic power. After the death of Haakon VI of Norway in 1380, his son Olav IV of Norway succeeded to both the thrones of Norway and Denmark and also claimed the Kingdom of Sweden (holding its westernmost provinces already). Only after his death at the age of 17 his mother Margaret managed to oust their rival, king Albert, from Sweden, and thus united the three Scandinavian kingdoms in personal union under one crown, in the Kalmar Union. Olav's death extinguished yet one Norwegian male royal line; he was also the last Norwegian king to be born on Norwegian soil