Fix a bug after refactoring the templating.