Fix template to support master-master replication