diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java
index 6737963abfea33a33af2f9c0bb6237f559597256..3e7d01dfed4a09eba5c3e0a1916855a3d8226097 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmAccount.java
@@ -17,6 +17,7 @@
 
 package org.matrix.olm;
 
+import android.text.TextUtils;
 import android.util.Log;
 
 import org.json.JSONObject;
@@ -61,7 +62,7 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
     private transient long mNativeId;
 
     public OlmAccount() throws OlmException {
-        initNewAccount();
+        createNewAccount();
     }
 
     /**
@@ -85,43 +86,23 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
      * Destroy the corresponding OLM account native object.<br>
      * This method must ALWAYS be called when this JAVA instance
      * is destroyed (ie. garbage collected) to prevent memory leak in native side.
-     * See {@link #initNewAccountJni()}.
+     * See {@link #createNewAccountJni()}.
      */
     private native void releaseAccountJni();
 
     /**
      * Create and initialize a native account instance.<br>
-     * Wrapper for {@link #initNewAccountJni()}.
      * To be called before any other API call.
      * @exception OlmException the failure reason
      */
-    private void initNewAccount() throws OlmException {
+    private void createNewAccount() throws OlmException {
         try {
-            mNativeId = initNewAccountJni();
+            mNativeId = createNewAccountJni();
         } catch (Exception e) {
             throw new OlmException(OlmException.EXCEPTION_CODE_INIT_ACCOUNT_CREATION, e.getMessage());
         }
     }
 
-    /**
-     * Create and initialize an OLM account in native side.<br>
-     * Do not forget to call {@link #releaseAccount()} when JAVA side is done.
-     * @return native account instance identifier (see {@link #mNativeId})
-     */
-    private native long initNewAccountJni();
-
-    /**
-     * Create a native account instance without any initialization.<br>
-     * Since the account is left uninitialized, this
-     * method is intended to be used in the serialization mechanism (see {@link #readObject(ObjectInputStream)}).<br>
-     * Public wrapper for {@link #createNewAccountJni()}.
-     * @return true if init succeed, false otherwise.
-     */
-    private boolean createNewAccount() {
-        mNativeId = initNewAccountJni();
-        return (0 != mNativeId);
-    }
-
     /**
      * Create an OLM account in native side.<br>
      * Do not forget to call {@link #releaseAccount()} when JAVA side is done.
@@ -408,10 +389,9 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
     /**
      * Kick off the deserialization mechanism.
      * @param aInStream input stream
-     * @throws IOException exception
-     * @throws ClassNotFoundException exception
+     * @throws Exception exception
      */
-    private void readObject(ObjectInputStream aInStream) throws IOException, ClassNotFoundException {
+    private void readObject(ObjectInputStream aInStream) throws Exception {
         deserialize(aInStream);
     }
 
@@ -453,31 +433,28 @@ public class OlmAccount extends CommonSerializeUtils implements Serializable {
      * See {@link #serialize(byte[], StringBuffer)}
      * @param aSerializedData bytes buffer
      * @param aKey key used to encrypted
+     * @exception Exception the exception
      */
     @Override
-    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws IOException {
-        if (!createNewAccount()) {
-            throw new OlmException(OlmException.EXCEPTION_CODE_INIT_ACCOUNT_CREATION,OlmException.EXCEPTION_MSG_INIT_ACCOUNT_CREATION);
-        }
-
-        StringBuffer errorMsg = new StringBuffer();
+    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws Exception {
+        createNewAccount();
+        String errorMsg;
 
         try {
-            String jniError;
             if ((null == aSerializedData) || (null == aKey)) {
                 Log.e(LOG_TAG, "## deserialize(): invalid input parameters");
-                errorMsg.append("invalid input parameters");
-            } else if (null != (jniError = deserializeJni(aSerializedData, aKey))) {
-                errorMsg.append(jniError);
+                errorMsg = "invalid input parameters";
+            } else {
+                errorMsg = deserializeJni(aSerializedData, aKey);
             }
         } catch (Exception e) {
             Log.e(LOG_TAG, "## deserialize() failed " + e.getMessage());
-            errorMsg.append(e.getMessage());
+            errorMsg = e.getMessage();
         }
 
-        if (errorMsg.length() > 0) {
+        if (!TextUtils.isEmpty(errorMsg)) {
             releaseAccount();
-            throw new OlmException(OlmException.EXCEPTION_CODE_ACCOUNT_DESERIALIZATION, String.valueOf(errorMsg));
+            throw new OlmException(OlmException.EXCEPTION_CODE_ACCOUNT_DESERIALIZATION, errorMsg);
         }
     }
 
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmException.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmException.java
index d02b7fcea0bbd40218961d9d4ec847aa07e22c34..155724b1ea0f2825f5bd71b4ec1981a7d59691f4 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmException.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmException.java
@@ -55,6 +55,7 @@ public class OlmException extends IOException {
     public static final int EXCEPTION_CODE_SESSION_DECRYPT_MESSAGE = 405;
     public static final int EXCEPTION_CODE_SESSION_SESSION_IDENTIFIER = 406;
 
+    public static final int EXCEPTION_CODE_UTILITY_CREATION = 501;
     public static final int EXCEPTION_CODE_UTILITY_VERIFY_SIGNATURE = 500;
 
     // exception human readable messages
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
index dc1b80d112c3a17ebb32a9aa9bffb9ed5dd970af..d9075c8d88063d772fe44ba920a3433193ae5a2e 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmInboundGroupSession.java
@@ -61,11 +61,8 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri
      * @throws OlmException constructor failure
      */
     public OlmInboundGroupSession(String aSessionKey) throws OlmException {
-        if(createNewSession()) {
-            initInboundGroupSession(aSessionKey);
-        } else {
-            throw new OlmException(OlmException.EXCEPTION_CODE_CREATE_INBOUND_GROUP_SESSION, OlmException.EXCEPTION_MSG_NEW_INBOUND_GROUP_SESSION);
-        }
+        createNewSession();
+        initInboundGroupSession(aSessionKey);
     }
 
     /**
@@ -88,11 +85,14 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri
     /**
      * Create and save the session native instance ID.<br>
      * To be called before any other API call.
-     * @return true if init succeed, false otherwise.
+     * @exception OlmException the failure reason
      */
-    private boolean createNewSession() {
-        mNativeId = createNewSessionJni();
-        return (0 != mNativeId);
+    private void createNewSession() throws OlmException {
+        try {
+            mNativeId = createNewSessionJni();
+        } catch (Exception e) {
+            throw new OlmException(OlmException.EXCEPTION_CODE_CREATE_INBOUND_GROUP_SESSION, e.getMessage());
+        }
     }
 
     /**
@@ -190,10 +190,9 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri
     /**
      * Kick off the deserialization mechanism.
      * @param aInStream input stream
-     * @throws IOException exception
-     * @throws ClassNotFoundException exception
+     * @throws Exception exception
      */
-    private void readObject(ObjectInputStream aInStream) throws IOException, ClassNotFoundException {
+    private void readObject(ObjectInputStream aInStream) throws Exception {
         deserialize(aInStream);
     }
 
@@ -242,29 +241,26 @@ public class OlmInboundGroupSession extends CommonSerializeUtils implements Seri
      * @param aKey key used to encrypted
      */
     @Override
-    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws IOException {
-        if (!createNewSession()) {
-            throw new OlmException(OlmException.EXCEPTION_CODE_INIT_ACCOUNT_CREATION,OlmException.EXCEPTION_MSG_INIT_ACCOUNT_CREATION);
-        }
+    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws Exception {
+        createNewSession();
 
-        StringBuffer errorMsg = new StringBuffer();
+        String errorMsg;
 
         try {
-            String jniError;
             if ((null == aSerializedData) || (null == aKey)) {
                 Log.e(LOG_TAG, "## deserialize(): invalid input parameters");
-                errorMsg.append("invalid input parameters");
-            } else if (null != (jniError = deserializeJni(aSerializedData, aKey))) {
-                errorMsg.append(jniError);
+                errorMsg = "invalid input parameters";
+            } else {
+                errorMsg = deserializeJni(aSerializedData, aKey);
             }
         } catch (Exception e) {
             Log.e(LOG_TAG, "## deserialize() failed " + e.getMessage());
-            errorMsg.append(e.getMessage());
+            errorMsg = e.getMessage();
         }
 
-        if (errorMsg.length() > 0) {
+        if (!TextUtils.isEmpty(errorMsg)) {
             releaseSession();
-            throw new OlmException(OlmException.EXCEPTION_CODE_ACCOUNT_DESERIALIZATION, String.valueOf(errorMsg));
+            throw new OlmException(OlmException.EXCEPTION_CODE_ACCOUNT_DESERIALIZATION, errorMsg);
         }
     }
 
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java
index 16053927cc8f48794694768177e2d0742f9d979f..2efb0c2c2a5c127e4e882c11e3888b62f6745fd0 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmManager.java
@@ -42,8 +42,6 @@ public class OlmManager {
     }
 
     public String getSdkOlmVersion() {
-        //Date currentDate = Calendar.getInstance().getTime();
-        //String retVal = new SimpleDateFormat("yyyyMMdd_HH:mm:ss").format(currentDate);
         return SDK_OLM_VERSION;
     }
 
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmOutboundGroupSession.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmOutboundGroupSession.java
index 534636c0efbee344014887f69809c6acb4f2e1b5..a7972d3b22a75827be1489e531e0b652d77e2429 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmOutboundGroupSession.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmOutboundGroupSession.java
@@ -50,11 +50,8 @@ public class OlmOutboundGroupSession extends CommonSerializeUtils implements Ser
      * @throws OlmException constructor failure
      */
     public OlmOutboundGroupSession() throws OlmException {
-        if(createNewSession()) {
-            initOutboundGroupSession();
-        } else {
-            throw new OlmException(OlmException.EXCEPTION_CODE_CREATE_OUTBOUND_GROUP_SESSION, OlmException.EXCEPTION_MSG_NEW_OUTBOUND_GROUP_SESSION);
-        }
+        createNewSession();
+        initOutboundGroupSession();
     }
 
     /**
@@ -78,11 +75,14 @@ public class OlmOutboundGroupSession extends CommonSerializeUtils implements Ser
      * Create and save the session native instance ID.
      * Wrapper for {@link #createNewSessionJni()}.<br>
      * To be called before any other API call.
-     * @return true if init succeed, false otherwise.
+     * @exception OlmException the exception.
      */
-    private boolean createNewSession() {
-        mNativeId = createNewSessionJni();
-        return (0 != mNativeId);
+    private void createNewSession() throws OlmException {
+        try {
+            mNativeId = createNewSessionJni();
+        } catch (Exception e) {
+            throw new OlmException(OlmException.EXCEPTION_CODE_CREATE_OUTBOUND_GROUP_SESSION, e.getMessage());
+        }
     }
 
     /**
@@ -203,10 +203,9 @@ public class OlmOutboundGroupSession extends CommonSerializeUtils implements Ser
     /**
      * Kick off the deserialization mechanism.
      * @param aInStream input stream
-     * @throws IOException exception
-     * @throws ClassNotFoundException exception
+     * @throws Exception exception
      */
-    private void readObject(ObjectInputStream aInStream) throws IOException, ClassNotFoundException {
+    private void readObject(ObjectInputStream aInStream) throws Exception {
         deserialize(aInStream);
     }
 
@@ -247,31 +246,29 @@ public class OlmOutboundGroupSession extends CommonSerializeUtils implements Ser
      * See {@link #serialize(byte[], StringBuffer)}
      * @param aSerializedData pickled account in a base64 bytes buffer
      * @param aKey key used to encrypted
+     * @exception Exception the exception
      */
     @Override
-    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws IOException {
-        if (!createNewSession()) {
-            throw new OlmException(OlmException.EXCEPTION_CODE_INIT_ACCOUNT_CREATION,OlmException.EXCEPTION_MSG_INIT_ACCOUNT_CREATION);
-        }
+    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws Exception {
+        createNewSession();
 
-        StringBuffer errorMsg = new StringBuffer();
+        String errorMsg = null;
 
         try {
-            String jniError;
             if ((null == aSerializedData) || (null == aKey)) {
                 Log.e(LOG_TAG, "## deserialize(): invalid input parameters");
-                errorMsg.append("invalid input parameters");
-            } else if (null != (jniError = deserializeJni(aSerializedData, aKey))) {
-                errorMsg.append(jniError);
+                errorMsg = "invalid input parameters";
+            } else {
+                errorMsg = deserializeJni(aSerializedData, aKey);
             }
         } catch (Exception e) {
             Log.e(LOG_TAG, "## deserialize() failed " + e.getMessage());
-            errorMsg.append(e.getMessage());
+            errorMsg = e.getMessage();
         }
 
-        if (errorMsg.length() > 0) {
+        if (!TextUtils.isEmpty(errorMsg)) {
             releaseSession();
-            throw new OlmException(OlmException.EXCEPTION_CODE_ACCOUNT_DESERIALIZATION, String.valueOf(errorMsg));
+            throw new OlmException(OlmException.EXCEPTION_CODE_ACCOUNT_DESERIALIZATION, errorMsg);
         }
     }
 
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java
index bc190ede2aab3390721c9ceb4f9bbca5a12d7869..2436f0d7415512afff11a9e0287cc2d11f0fe4cb 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmSession.java
@@ -43,9 +43,7 @@ public class OlmSession extends CommonSerializeUtils implements Serializable {
     private transient long mNativeId;
 
     public OlmSession() throws OlmException {
-        if(!initNewSession()) {
-            throw new OlmException(OlmException.EXCEPTION_CODE_INIT_SESSION_CREATION, OlmException.EXCEPTION_MSG_INIT_SESSION_CREATION);
-        }
+        createNewSession();
     }
 
     /**
@@ -60,7 +58,7 @@ public class OlmSession extends CommonSerializeUtils implements Serializable {
      * Destroy the corresponding OLM session native object.<br>
      * This method must ALWAYS be called when this JAVA instance
      * is destroyed (ie. garbage collected) to prevent memory leak in native side.
-     * See {@link #initNewSessionJni()}.
+     * See {@link #createNewSessionJni()}.
      */
     private native void releaseSessionJni();
 
@@ -73,34 +71,19 @@ public class OlmSession extends CommonSerializeUtils implements Serializable {
         mNativeId = 0;
     }
 
-    /**
-     * Create and save the session native instance ID.
-     * Wrapper for {@link #initNewSessionJni()}.<br>
-     * To be called before any other API call.
-     * @return true if init succeed, false otherwise.
-     */
-    private boolean initNewSession() {
-        mNativeId = initNewSessionJni();
-        return (0 != mNativeId);
-    }
-
-    /**
-     * Create the corresponding OLM session in native side.<br>
-     * Do not forget to call {@link #releaseSession()} when JAVA side is done.
-     * @return native session instance identifier (see {@link #mNativeId})
-     */
-    private native long initNewSessionJni();
-
     /**
      * Create a native account instance without any initialization.<br>
      * Since the account is left uninitialized, this
      * method is intended to be used in the serialization mechanism (see {@link #readObject(ObjectInputStream)}).<br>
      * Public wrapper for {@link #createNewSessionJni()}.
-     * @return true if init succeed, false otherwise.
+     * @exception OlmException the exception
      */
-    private boolean createNewSession() {
-        mNativeId = initNewSessionJni();
-        return (0 != mNativeId);
+    private void createNewSession() throws OlmException {
+        try {
+            mNativeId = createNewSessionJni();
+        } catch (Exception e) {
+            throw new OlmException(OlmException.EXCEPTION_CODE_INIT_SESSION_CREATION, e.getMessage());
+        }
     }
 
     /**
@@ -331,7 +314,7 @@ public class OlmSession extends CommonSerializeUtils implements Serializable {
      * @throws IOException exception
      * @throws ClassNotFoundException exception
      */
-    private void readObject(ObjectInputStream aInStream) throws IOException, ClassNotFoundException {
+    private void readObject(ObjectInputStream aInStream) throws Exception  {
         deserialize(aInStream);
     }
 
@@ -374,10 +357,8 @@ public class OlmSession extends CommonSerializeUtils implements Serializable {
      * @param aKey key used to encrypted
      */
     @Override
-    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws IOException {
-        if (!createNewSession()) {
-            throw new OlmException(OlmException.EXCEPTION_CODE_INIT_ACCOUNT_CREATION,OlmException.EXCEPTION_MSG_INIT_ACCOUNT_CREATION);
-        }
+    protected void deserialize(byte[] aSerializedData, byte[] aKey) throws Exception {
+        createNewSession();
 
         StringBuffer errorMsg = new StringBuffer();
 
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java
index 3b1d9e1a45d3f46edd19e011696c4ca6c4c69ee3..d520da61e967f8b84cd88a8e209847f7ea419a57 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/java/org/matrix/olm/OlmUtility.java
@@ -29,7 +29,6 @@ public class OlmUtility {
     private static final String LOG_TAG = "OlmUtility";
 
     public static final int RANDOM_KEY_SIZE = 32;
-    public static final int RANDOM_RANGE = 256;
 
     /** Instance Id returned by JNI.
      * This value uniquely identifies this utility instance.
@@ -46,11 +45,11 @@ public class OlmUtility {
      * @return true if init succeed, false otherwise.
      */
     private boolean initUtility() {
-        mNativeId = initUtilityJni();
+        mNativeId = createUtilityJni();
         return (0 != mNativeId);
     }
 
-    private native long initUtilityJni();
+    private native long createUtilityJni();
 
     /**
      * Release native instance.<br>
@@ -136,6 +135,12 @@ public class OlmUtility {
         SecureRandom secureRandom = new SecureRandom();
         byte[] buffer = new byte[RANDOM_KEY_SIZE];
         secureRandom.nextBytes(buffer);
+
+        // the key is saved as string
+        // so avoid the UTF8 marker bytes
+        for(int i = 0; i < RANDOM_KEY_SIZE; i++) {
+            buffer[i] = (byte)(buffer[i] & 0x7F);
+        }
         return buffer;
     }
 
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.cpp
index 7441da4bd3f41afd0115578fffe6923bd5215977..4da0d6765fa294266df1e3da5b64e27a8d8cbc82 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.cpp
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.cpp
@@ -42,49 +42,13 @@ OlmAccount* initializeAccountMemory()
     return accountPtr;
 }
 
-JNIEXPORT jlong OLM_ACCOUNT_FUNC_DEF(createNewAccountJni)(JNIEnv *env, jobject thiz)
-{
-    LOGD("## createNewAccountJni(): IN");
-    OlmAccount* accountPtr = initializeAccountMemory();
-
-    LOGD(" ## createNewAccountJni(): success - accountPtr=%p (jlong)(intptr_t)accountPtr=%lld",accountPtr,(jlong)(intptr_t)accountPtr);
-    return (jlong)(intptr_t)accountPtr;
-}
-
-/**
- * Release the account allocation made by initializeAccountMemory().<br>
- * This method MUST be called when java counter part account instance is done.
- *
- */
-JNIEXPORT void OLM_ACCOUNT_FUNC_DEF(releaseAccountJni)(JNIEnv *env, jobject thiz)
-{
-    LOGD("## releaseAccountJni(): IN");
-
-    OlmAccount* accountPtr = getAccountInstanceId(env, thiz);
-
-    if (!accountPtr)
-    {
-        LOGE(" ## releaseAccountJni(): failure - invalid Account ptr=NULL");
-    }
-    else
-    {
-        LOGD(" ## releaseAccountJni(): accountPtr=%p",accountPtr);
-        olm_clear_account(accountPtr);
-
-        LOGD(" ## releaseAccountJni(): IN");
-        // even if free(NULL) does not crash, logs are performed for debug purpose
-        free(accountPtr);
-        LOGD(" ## releaseAccountJni(): OUT");
-    }
-}
-
 /**
-* Initialize a new account and return it to JAVA side.<br>
+* Create a new account and return it to JAVA side.<br>
 * Since a C prt is returned as a jlong, special care will be taken
 * to make the cast (OlmAccount* => jlong) platform independent.
 * @return the initialized OlmAccount* instance
 **/
-JNIEXPORT jlong OLM_ACCOUNT_FUNC_DEF(initNewAccountJni)(JNIEnv *env, jobject thiz)
+JNIEXPORT jlong OLM_ACCOUNT_FUNC_DEF(createNewAccountJni)(JNIEnv *env, jobject thiz)
 {
     const char* errorMessage = NULL;
     OlmAccount *accountPtr = initializeAccountMemory();
@@ -139,6 +103,32 @@ JNIEXPORT jlong OLM_ACCOUNT_FUNC_DEF(initNewAccountJni)(JNIEnv *env, jobject thi
 
     return (jlong)(intptr_t)accountPtr;
 }
+/**
+ * Release the account allocation made by initializeAccountMemory().<br>
+ * This method MUST be called when java counter part account instance is done.
+ *
+ */
+JNIEXPORT void OLM_ACCOUNT_FUNC_DEF(releaseAccountJni)(JNIEnv *env, jobject thiz)
+{
+    LOGD("## releaseAccountJni(): IN");
+
+    OlmAccount* accountPtr = getAccountInstanceId(env, thiz);
+
+    if (!accountPtr)
+    {
+        LOGE(" ## releaseAccountJni(): failure - invalid Account ptr=NULL");
+    }
+    else
+    {
+        LOGD(" ## releaseAccountJni(): accountPtr=%p",accountPtr);
+        olm_clear_account(accountPtr);
+
+        LOGD(" ## releaseAccountJni(): IN");
+        // even if free(NULL) does not crash, logs are performed for debug purpose
+        free(accountPtr);
+        LOGD(" ## releaseAccountJni(): OUT");
+    }
+}
 
 // *********************************************************************
 // ************************* IDENTITY KEYS API *************************
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.h b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.h
index 5b73acdb85e0c54433c20fcaf90e7c2ebf8fb2ba..2bfb39c0156c176c39de96a8d43965f4f965fc50 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.h
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_account.h
@@ -30,7 +30,6 @@ extern "C" {
 
 // account creation/destruction
 JNIEXPORT void OLM_ACCOUNT_FUNC_DEF(releaseAccountJni)(JNIEnv *env, jobject thiz);
-JNIEXPORT jlong OLM_ACCOUNT_FUNC_DEF(initNewAccountJni)(JNIEnv *env, jobject thiz);
 JNIEXPORT jlong OLM_ACCOUNT_FUNC_DEF(createNewAccountJni)(JNIEnv *env, jobject thiz);
 
 // identity keys
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp
index dd3e0a9bcd07c690278943a6ba2f10cb3949291b..7dd250bd4549e93f6b455e3d09434ff6d1287d53 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_inbound_group_session.cpp
@@ -58,6 +58,7 @@ JNIEXPORT void OLM_INBOUND_GROUP_SESSION_FUNC_DEF(releaseSessionJni)(JNIEnv *env
 **/
 JNIEXPORT jlong OLM_INBOUND_GROUP_SESSION_FUNC_DEF(createNewSessionJni)(JNIEnv *env, jobject thiz)
 {
+    const char* errorMessage = NULL;
     OlmInboundGroupSession* sessionPtr = NULL;
     size_t sessionSize = 0;
 
@@ -67,6 +68,7 @@ JNIEXPORT jlong OLM_INBOUND_GROUP_SESSION_FUNC_DEF(createNewSessionJni)(JNIEnv *
     if (!sessionSize)
     {
         LOGE(" ## createNewSessionJni(): failure - inbound group session size = 0");
+        errorMessage = "inbound group session size = 0";
     }
     else if ((sessionPtr = (OlmInboundGroupSession*)malloc(sessionSize)))
     {
@@ -76,6 +78,12 @@ JNIEXPORT jlong OLM_INBOUND_GROUP_SESSION_FUNC_DEF(createNewSessionJni)(JNIEnv *
     else
     {
         LOGE(" ## createNewSessionJni(): failure - inbound group session OOM");
+        errorMessage = "inbound group session OOM";
+    }
+
+    if (errorMessage)
+    {
+        env->ThrowNew(env->FindClass("java/lang/Exception"), errorMessage);
     }
 
     return (jlong)(intptr_t)sessionPtr;
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp
index d1459aec64c06f9795baffcc91cd36bb30757169..6e26071ecc3df6531ecdc9d62c208a1e4f4a5fda 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.cpp
@@ -48,7 +48,16 @@ JNIEXPORT jlong OLM_SESSION_FUNC_DEF(createNewSessionJni)(JNIEnv *env, jobject t
     LOGD("## createNewSessionJni(): IN");
     OlmSession* accountPtr = initializeSessionMemory();
 
-    LOGD(" ## createNewSessionJni(): success - accountPtr=%p (jlong)(intptr_t)accountPtr=%lld",accountPtr,(jlong)(intptr_t)accountPtr);
+    if (!accountPtr)
+    {
+        LOGE("## initNewAccount(): failure - init session OOM");
+        env->ThrowNew(env->FindClass("java/lang/Exception"), "init session OOM");
+    }
+    else
+    {
+        LOGD(" ## createNewSessionJni(): success - accountPtr=%p (jlong)(intptr_t)accountPtr=%lld",accountPtr,(jlong)(intptr_t)accountPtr);
+    }
+
     return (jlong)(intptr_t)accountPtr;
 }
 
@@ -70,31 +79,6 @@ JNIEXPORT void OLM_SESSION_FUNC_DEF(releaseSessionJni)(JNIEnv *env, jobject thiz
     }
 }
 
-/**
-* Initialize a new session and return it to JAVA side.<br>
-* Since a C prt is returned as a jlong, special care will be taken
-* to make the cast (OlmSession* => jlong) platform independent.
-* @return the initialized OlmSession* instance if init succeed, NULL otherwise
-**/
-JNIEXPORT jlong OLM_SESSION_FUNC_DEF(initNewSessionJni)(JNIEnv *env, jobject thiz)
-{
-    LOGD("## initNewSessionJni(): OlmSession IN");
-
-    OlmSession* sessionPtr = initializeSessionMemory();
-
-    // init account memory allocation
-    if (!sessionPtr)
-    {
-        LOGE(" ## initNewSessionJni(): failure - init session OOM");
-    }
-    else
-    {
-        LOGD(" ## initNewSessionJni(): success - OLM session created");
-    }
-
-    return (jlong)(intptr_t)sessionPtr;
-}
-
 // *********************************************************************
 // ********************** OUTBOUND SESSION *****************************
 // *********************************************************************
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.h b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.h
index ef92395d59bcc152b72f705ce3282f390f66ed7b..76f59c52d7c0502322b7731492cddaf8e86b7f05 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.h
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_session.h
@@ -29,7 +29,6 @@ extern "C" {
 
 // session creation/destruction
 JNIEXPORT void OLM_SESSION_FUNC_DEF(releaseSessionJni)(JNIEnv *env, jobject thiz);
-JNIEXPORT jlong OLM_SESSION_FUNC_DEF(initNewSessionJni)(JNIEnv *env, jobject thiz);
 JNIEXPORT jlong OLM_SESSION_FUNC_DEF(createNewSessionJni)(JNIEnv *env, jobject thiz);
 
 // outbound session
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.cpp b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.cpp
index c4e68118519d59da5a8731e6d16edb635f205515..b26cfae26cce3fed509436fa28583ac011cf15d3 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.cpp
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.cpp
@@ -37,20 +37,21 @@ OlmUtility* initializeUtilityMemory()
     return utilityPtr;
 }
 
-JNIEXPORT jlong OLM_UTILITY_FUNC_DEF(initUtilityJni)(JNIEnv *env, jobject thiz)
+JNIEXPORT jlong OLM_UTILITY_FUNC_DEF(createUtilityJni)(JNIEnv *env, jobject thiz)
 {
     OlmUtility* utilityPtr = initializeUtilityMemory();
 
-    LOGD("## initUtilityJni(): IN");
+    LOGD("## createUtilityJni(): IN");
 
     // init account memory allocation
     if (!utilityPtr)
     {
-        LOGE(" ## initUtilityJni(): failure - init OOM");
+        LOGE(" ## createUtilityJni(): failure - init OOM");
+        env->ThrowNew(env->FindClass("java/lang/Exception"), "init OOM");
     }
     else
     {
-       LOGD(" ## initUtilityJni(): success");
+       LOGD(" ## createUtilityJni(): success");
     }
 
     return (jlong)(intptr_t)utilityPtr;
diff --git a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.h b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.h
index 16d9e7ab11b8fb676f7ff60c384002c6f3a3eaba..de4b2905e6852793265e6d8aba75d95b64eebd29 100644
--- a/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.h
+++ b/java/android/OlmLibSdk/olm-sdk/src/main/jni/olm_utility.h
@@ -27,7 +27,7 @@
 #ifdef __cplusplus
 extern "C" {
 #endif
-JNIEXPORT jlong   OLM_UTILITY_FUNC_DEF(initUtilityJni)(JNIEnv *env, jobject thiz);
+JNIEXPORT jlong   OLM_UTILITY_FUNC_DEF(createUtilityJni)(JNIEnv *env, jobject thiz);
 JNIEXPORT void    OLM_UTILITY_FUNC_DEF(releaseUtilityJni)(JNIEnv *env, jobject thiz);
 JNIEXPORT jstring OLM_UTILITY_FUNC_DEF(verifyEd25519SignatureJni)(JNIEnv *env, jobject thiz, jbyteArray aSignature, jbyteArray aKey, jbyteArray aMessage);
 JNIEXPORT jbyteArray OLM_UTILITY_FUNC_DEF(sha256Jni)(JNIEnv *env, jobject thiz, jbyteArray aMessageToHash);