final tested options. also fixed jni warnings