Correct template errors