Fixed Template deletion