Correctly insert terms even with scoping (I hope)