Do not use typename outside of templates

Closes #2231
Review 1413 by @srh