Fix bugs when AI delcares wars or sign treaties.