Fix compiler errors in template example