diff --git a/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/StorageTests.java b/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/StorageTests.java
index 3f36bd7..6899ba0 100644
--- a/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/StorageTests.java
+++ b/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/StorageTests.java
@@ -237,17 +237,8 @@
     IStorage storage = factory.create(APPLICATION_TOKEN);
     IBlob blob = storage.getBlob(KEY);
     blob.setETag(WRONG_ETAG);
-
-    try
-    {
-      blob.setContentsUTF("Text 2"); // Update attempt 1
-      fail("ConflictException expected");
-    }
-    catch (ConflictException expected)
-    {
-      assertThat(expected.getETag(), isNull());
-      assertThat(blob.getETag(), isNull());
-    }
+    blob.setContentsUTF("Text 2"); // Update attempt 1
+    assertThat(blob.getETag(), isNotNull());
   }
 
   @Test
diff --git a/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/util/USSServer.java b/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/util/USSServer.java
index be2fe4f..6af036f 100644
--- a/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/util/USSServer.java
+++ b/org.eclipse.userstorage.tests/src/org/eclipse/userstorage/tests/util/USSServer.java
@@ -352,14 +352,6 @@
         return;
       }
     }
-    else
-    {
-      if (!StringUtil.isEmpty(ifMatch))
-      {
-        response.sendError(HttpServletResponse.SC_CONFLICT);
-        return;
-      }
-    }
 
     String etag = UUID.randomUUID().toString();
 
diff --git a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java
index 3d9d831..9ef8932 100644
--- a/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java
+++ b/org.eclipse.userstorage/src/org/eclipse/userstorage/internal/Session.java
@@ -243,35 +243,21 @@
       {
         String eTag = getETag(response);
 
-        try
+        int statusCode = getStatusCode("PUT", uri, response, OK, CREATED, CONFLICT);
+
+        if (statusCode == CONFLICT)
         {
-          int statusCode = getStatusCode("PUT", uri, response, OK, CREATED, CONFLICT);
-
-          if (statusCode == CONFLICT)
-          {
-            StatusLine statusLine = response.getStatusLine();
-            throw new ConflictException("PUT", uri, getProtocolVersion(statusLine), statusLine.getReasonPhrase(), eTag);
-          }
-
-          if (eTag == null)
-          {
-            throw new ProtocolException("PUT", uri, getProtocolVersion(response.getStatusLine()), BAD_RESPONSE, "Bad Response : No ETag");
-          }
-
-          properties.put(Blob.ETAG, eTag);
-          return statusCode == CREATED;
+          StatusLine statusLine = response.getStatusLine();
+          throw new ConflictException("PUT", uri, getProtocolVersion(statusLine), statusLine.getReasonPhrase(), eTag);
         }
-        catch (ProtocolException ex)
+
+        if (eTag == null)
         {
-          int xxx;
-          if (ex.getStatusCode() == BAD_REQUEST && ex.getReasonPhrase().contains("The resource already exist"))
-          {
-            StatusLine statusLine = response.getStatusLine();
-            throw new ConflictException("PUT", uri, getProtocolVersion(statusLine), "The resource already exists.", eTag);
-          }
-
-          throw ex;
+          throw new ProtocolException("PUT", uri, getProtocolVersion(response.getStatusLine()), BAD_RESPONSE, "Bad Response : No ETag");
         }
+
+        properties.put(Blob.ETAG, eTag);
+        return statusCode == CREATED;
       }
     }.send(credentialsProvider);
   }
@@ -333,11 +319,11 @@
     if (headers != null && headers.length != 0)
     {
       String eTag = headers[0].getValue();
-
-      // Remove the quotes.
-      eTag = eTag.substring(1, eTag.length() - 1);
-
-      return eTag;
+      if (!StringUtil.isEmpty(eTag))
+      {
+        // Remove the quotes.
+        return eTag.substring(1, eTag.length() - 1);
+      }
     }
 
     return null;
