Fix incorrect usage of 'typename' outside a template.

Original code was ported from a templated function to a non-template, but only
tested on compilers that don't compare about unnecessary 'typenames'.