Correcting the location of a template