fixes to cpp wrappers