Changed some minor things.
Added JNI optimization for native buffers.