Properly handle repetition rules for template tasks.