Add cooldown to templates.
Fix catching of undefined.