diff --git a/src/EncryptedFieldValueManager.php b/src/EncryptedFieldValueManager.php
index b83e8db..791dcf4 100644
--- a/src/EncryptedFieldValueManager.php
+++ b/src/EncryptedFieldValueManager.php
@@ -58,7 +58,7 @@ class EncryptedFieldValueManager implements EncryptedFieldValueManagerInterface
       // Create a new EncryptedFieldValue entity. The parent entity's (revision)
       // id might not be known yet, so the EncryptedFieldValue will be saved
       // by saveEncryptedFieldValues() later on.
-      $encrypted_field_value = $this->entityManager->getStorage($entity->getEntityTypeId())->create([
+      $encrypted_field_value = $this->entityManager->getStorage('encrypted_field_value')->create([
         'entity_type' => $entity->getEntityTypeId(),
         'entity_id' => !$entity->isNew() ? $entity->id() : NULL,
         'entity_revision_id' => $this->getEntityRevisionId($entity),
@@ -180,7 +180,8 @@ class EncryptedFieldValueManager implements EncryptedFieldValueManagerInterface
     if ($entity->isNew()) {
       return NULL;
     }
-    return $entity->getRevisionId() ?: $entity->id();
+
+    return $entity->getEntityType()->hasKey('revision') ? $entity->getRevisionId() : $entity->id();
   }
 
 }
diff --git a/src/Tests/FieldEncryptTest.php b/src/Tests/FieldEncryptTest.php
index af6fd66..0eebe27 100644
--- a/src/Tests/FieldEncryptTest.php
+++ b/src/Tests/FieldEncryptTest.php
@@ -237,7 +237,7 @@ class FieldEncryptTest extends FieldEncryptTestBase {
 
     // Check existence of EncryptedFieldValue entities.
     $encrypted_field_values = EncryptedFieldValue::loadMultiple();
-    $this->assertEqual(5, count($encrypted_field_values));
+    $this->assertEqual(10, count($encrypted_field_values));
 
     // Check if English text is displayed unencrypted.
     $this->drupalGet('node/' . $this->testNode->id());
@@ -246,7 +246,7 @@ class FieldEncryptTest extends FieldEncryptTestBase {
     $this->assertText("two");
     $this->assertText("three");
 
-    // Check if English text is displayed unencrypted.
+    // Check if French text is displayed unencrypted.
     $this->drupalGet('fr/node/' . $this->testNode->id());
     $this->assertText("Ceci est un text francais.");
     $this->assertText("un");
diff --git a/src/Tests/FieldEncryptTestBase.php b/src/Tests/FieldEncryptTestBase.php
index fa302d2..b5ca0f3 100644
--- a/src/Tests/FieldEncryptTestBase.php
+++ b/src/Tests/FieldEncryptTestBase.php
@@ -17,8 +17,6 @@ use Drupal\simpletest\WebTestBase;
 
 /**
  * Base test class for field_encrypt.
- *
- * @group field_encrypt
  */
 abstract class FieldEncryptTestBase extends WebTestBase {
 
diff --git a/tests/src/Unit/EncryptedFieldValueManagerTest.php b/tests/src/Unit/EncryptedFieldValueManagerTest.php
index d6ca8fc..4ed0a3c 100644
--- a/tests/src/Unit/EncryptedFieldValueManagerTest.php
+++ b/tests/src/Unit/EncryptedFieldValueManagerTest.php
@@ -138,7 +138,7 @@ class EncryptedFieldValueManagerTest extends UnitTestCase {
     // some methods.
     /** @var \Drupal\field_encrypt\EncryptedFieldValueManager $service */
     $service = $this->getMockBuilder('\Drupal\field_encrypt\EncryptedFieldValueManager')
-      ->setMethods(['getExistingEntity'])
+      ->setMethods(['getExistingEntity', 'getEntityRevisionId'])
       ->setConstructorArgs(array(
         $this->entityManager,
         $this->entityQuery,
diff --git a/tests/src/Unit/FieldEncryptProcessEntitiesTest.php b/tests/src/Unit/FieldEncryptProcessEntitiesTest.php
index 47d8f15..ba1da3b 100644
--- a/tests/src/Unit/FieldEncryptProcessEntitiesTest.php
+++ b/tests/src/Unit/FieldEncryptProcessEntitiesTest.php
@@ -11,6 +11,7 @@ use Drupal\Core\DependencyInjection\ContainerBuilder;
 use Drupal\Core\Extension\ModuleHandlerInterface;
 use Drupal\Core\Field\BaseFieldDefinition;
 use Drupal\Core\TypedData\DataDefinition;
+use Drupal\encrypt\EncryptionProfileInterface;
 use Drupal\field_encrypt\FieldEncryptProcessEntities;
 use Drupal\Tests\UnitTestCase;
 
@@ -143,7 +144,7 @@ class FieldEncryptProcessEntitiesTest extends UnitTestCase {
       ->disableOriginalConstructor()
       ->getMock();
 
-    $this->encryptionProfile = $this->getMockBuilder('\Drupal\encrypt\EncryptionProfile')
+    $this->encryptionProfile = $this->getMockBuilder(EncryptionProfileInterface::class)
       ->disableOriginalConstructor()
       ->getMock();
 
