Templates compilation errors fixing