Minor template bug fixes from upgrade