various template fixes