Simple term_expansion debugging

Jan W. has some useful details here.