Remove trailing dots in template
Fix zone file not being written if domain was dynamic