The section of code in error, as far as I can tell:

faction_defeated_by_player
icon diplomacy
format use faction_defeated