Fix building of cppapi
Fix some clang compiler warnings