Minor fixes in cpp templates

Change-Id: Iae8e443c992bf47febdb2778a563955719e2b626