Fix template relacement