CPP build fixes