Save context when merging topics.

Closes #2166