Fixed errors in templates