diff --git a/src/Plugin/DMU/Converter/HookEntityInfo.php b/src/Plugin/DMU/Converter/HookEntityInfo.php
index 74c1817..fb77059 100644
--- a/src/Plugin/DMU/Converter/HookEntityInfo.php
+++ b/src/Plugin/DMU/Converter/HookEntityInfo.php
@@ -2,7 +2,7 @@
 
 namespace Drupal\drupalmoduleupgrader\Plugin\DMU\Converter;
 
-use Drupal\Component\Utility\String;
+use Drupal\Component\Utility\SafeMarkup;
 use Drupal\drupalmoduleupgrader\ConverterBase;
 use Drupal\drupalmoduleupgrader\TargetInterface;
 use Drupal\drupalmoduleupgrader\Utility\StringTransformTrait;
@@ -67,7 +67,7 @@ class HookEntityInfo extends ConverterBase {
           $entity_type['controllers']['storage'] = $controller->getName()->getAbsolutePath();
         }
         else {
-          throw new \LogicException(String::format('Cannot get ahold of the controller class for @entity_type entity type.', ['@entity_type' => $id]));
+          throw new \LogicException(SafeMarkup::format('Cannot get ahold of the controller class for @entity_type entity type.', ['@entity_type' => $id]));
         }
       }
       else {
diff --git a/src/Target.php b/src/Target.php
index c79f511..14910f7 100644
--- a/src/Target.php
+++ b/src/Target.php
@@ -3,7 +3,7 @@
 namespace Drupal\drupalmoduleupgrader;
 
 use Doctrine\Common\Collections\ArrayCollection;
-use Drupal\Component\Utility\String;
+use Drupal\Component\Utility\SafeMarkup;
 use Symfony\Component\DependencyInjection\ContainerInterface;
 use Symfony\Component\Finder\Finder;
 
@@ -61,7 +61,7 @@ class Target implements TargetInterface {
       $this->basePath = $path;
     }
     else {
-      throw new \RuntimeException(String::format('Invalid base path: @path', ['@path' => $path]));
+      throw new \RuntimeException(SafeMarkup::format('Invalid base path: @path', ['@path' => $path]));
     }
   }
 
@@ -78,7 +78,7 @@ class Target implements TargetInterface {
         $this->id = subStr($info_file->getFilename(), 0, -5);
       }
       else {
-        throw new \RuntimeException(String::format('Could not find info file in @dir', ['@dir' => $dir]));
+        throw new \RuntimeException(SafeMarkup::format('Could not find info file in @dir', ['@dir' => $dir]));
       }
     }
     return $this->id;
