Fix template class/function type parsing