Updated jni cpp wrapper.