Fixed an incorrect variable in templates