Fixing variable names
Adding missing typename keywords.