Rearrange variable creation and term creation to get the term to be automatically assigned to a section when created.