Various template fixes