Fix bug when replacing disk when saving template