There's that rebelling city end turn ctd again.

Btw, with diplomacy (when giving a territory to the AI) the script doesn't put in a government. Also a question: If a territory rebels from you to another faction (in 1.5), does that activate a war between the two of you?