Cleanup template validation