In what two rare cases were local governments able to mitigate the impact of of European colonization through treaties?