Enabled logging. Some changes in template.