Minor safety updates to the new C++ api.