Template correction