Added checks if exception is thrown from selected JNI functions.