Fix template generation.