Fixes to cpp