were guaranteed religious freedoms, Frederick William had to return his conquests in Swedish Pomerania to Sweden. John II Casimir relinquished his claims to the Swedish throne. The Treaty of Oliva involved the Commonwealth, Brandenburg and Sweden and was guaranteed by Louis XIV of France. Frederick William's sovereign takeover met with resistance in the Duchy of Prussia. A nobility faction under Christian Ludwig von Kalckstein and Königsberg burghers led by Hieronymus Roth prepared an armed insurrection. The opposition formed a league in 1662 and appealed to the Commonwealth for assistance. The Commonwealth, preoccupied with the war with Russia and internal unrest in the military, extended no help. Frederick William's forces entered Königsberg and imprisoned the leaders of the rebellion. Von Kalckstein fled to Poland, but in 1670 was captured by a Prussian ruler's representative, taken to the Duchy and executed. The Deluge's long term deleterious effects included an increase in xenophobic attitudes and intolerance in Poland. The religious minorities, accused of supporting foreign adversaries, were persecuted and pressured to emigrate, in the case of the Polish Brethren forced to leave the country. The international standing of the Commonwealth power had become much diminished, especially (with the loss of control over a major part of Livonia and Eastern Prussia) in the crucially important Baltic Sea region. Treaty of Hadiach, war with Russia, Truce of Andrusovo and division of Ukraine The Polish–Lithuanian magnates were preoccupied with the issue of recovery of their old feudal lands in the east, lost to the Cossacks and Russia. There was one more and the most significant, even if belated and in the end botched, attempt to resolve the Cossack conflict in an amicable way, by including Ukraine as a partner in the Commonwealth federation. After Khmelnytsky's death Ivan Vyhovsky was chosen as the Cossack Hetman. Vyhovsky represented the Cossack upper strata and sought independence from Russia through an alliance with Charles Gustav and then the Commonwealth, where some of the leaders understood and wanted to amend the erroneousness of the past policies. An appropriate treaty was prepared by Yuri Nemyrych, an Arian and the Chamberlain of Kiev, who represented Vyhovski, and on John Casimir's side Stanisław Kazimierz Bieniewski, Voivode of Chernihiv, among others. The Treaty of Hadiach was signed on September 16, 1658. The provisions of the treaty, and of the proposed union, included the creation of the Duchy of Ruthenia, which, like the Grand Duchy of