Fixed template generation.