Fix templates and rebuild