Fix template to support master-master replication

When you have master-master replication, these 2 commands will break it.