change handling of temporary context models during encoding