Do not use typename outside of templates

Closes #2231
Review 1413 by @srh
Merge branch 'next' into sam_2130