Fix typo and missed variable in template