--- src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php	2017-01-23 16:26:12.679047866 +0100
+++ src/Plugin/pathauto/AliasType/EntityAliasTypeBase.php	2017-01-23 17:09:40.152030997 +0100
@@ -6,6 +6,7 @@ use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Entity\FieldableEntityInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Drupal\Core\Plugin\Context\Context;
@@ -47,6 +48,13 @@ class EntityAliasTypeBase extends Contex
   protected $entityTypeManager;
 
   /**
+   * The key/value manager service.
+   *
+   * @var \Drupal\Core\KeyValueStore\KeyValueFactoryInterface
+   */
+  protected $keyValue;
+
+  /**
    * The database connection.
    *
    * @var \Drupal\Core\Database\Connection
@@ -75,14 +83,17 @@ class EntityAliasTypeBase extends Contex
    *   The language manager service.
    * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
    *   The entity manager service.
+   * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value
+   *   The key/value manager service.
    * @param \Drupal\Core\Database\Connection $database
    *   The database connection.
    */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, EntityTypeManagerInterface $entity_type_manager, Connection $database) {
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, EntityTypeManagerInterface $entity_type_manager, KeyValueFactoryInterface $key_value, Connection $database) {
     parent::__construct($configuration, $plugin_id, $plugin_definition);
     $this->moduleHandler = $module_handler;
     $this->languageManager = $language_manager;
     $this->entityTypeManager = $entity_type_manager;
+    $this->keyValue = $key_value;
     $this->database = $database;
   }
 
@@ -97,6 +108,7 @@ class EntityAliasTypeBase extends Contex
       $container->get('module_handler'),
       $container->get('language_manager'),
       $container->get('entity_type.manager'),
+      $container->get('keyvalue'),
       $container->get('database')
     );
   }
@@ -280,14 +292,13 @@ class EntityAliasTypeBase extends Contex
     }
 
     $collection = 'pathauto_state.' . $this->getEntityTypeId();
-    $states = \Drupal::keyValue($collection)->getMultiple(array_keys($id_to_pid));
+    $states = $this->keyValue->get($collection)->getMultiple(array_keys($id_to_pid));
 
     foreach (array_keys($id_to_pid) as $id) {
       // Skip if pathauto processing is disabled.
-      if ($states[$id] == PathautoState::SKIP) {
-        continue;
+      if (isset($states[$id]) && $states[$id] == PathautoState::CREATE) {
+        $pids[] = $id_to_pid[$id];
       }
-      $pids[] = $id_to_pid[$id];
     }
     \Drupal::service('pathauto.alias_storage_helper')->deleteMultiple($pids);
   }
--- src/Plugin/pathauto/AliasType/ForumAliasType.php	2017-01-23 16:26:08.966101626 +0100
+++ src/Plugin/pathauto/AliasType/ForumAliasType.php	2017-01-23 17:09:30.569175755 +0100
@@ -6,6 +6,7 @@ use Drupal\Core\Config\ConfigFactoryInte
 use Drupal\Core\Database\Connection;
 use Drupal\Core\Entity\EntityTypeManagerInterface;
 use Drupal\Core\Extension\ModuleHandlerInterface;
+use Drupal\Core\KeyValueStore\KeyValueFactoryInterface;
 use Drupal\Core\Language\LanguageManagerInterface;
 use Drupal\Core\Plugin\ContainerFactoryPluginInterface;
 use Symfony\Component\DependencyInjection\ContainerInterface;
@@ -47,11 +48,15 @@ class ForumAliasType extends EntityAlias
    *   The language manager service.
    * @param \Drupal\Core\Entity\EntityTypeManagerInterface $entity_type_manager
    *   The entity manager service.
+   * @param \Drupal\Core\KeyValueStore\KeyValueFactoryInterface $key_value
+   *   The key/value manager service.
+   * @param \Drupal\Core\Database\Connection $database
+   *   The database service.
    * @param \Drupal\Core\Config\ConfigFactoryInterface $config_factory
    *   The config factory.
    */
-  public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, EntityTypeManagerInterface $entity_type_manager, Connection $database, ConfigFactoryInterface $config_factory) {
-    parent::__construct($configuration, $plugin_id, $plugin_definition, $module_handler, $language_manager, $entity_type_manager, $database);
+  public function __construct(array $configuration, $plugin_id, $plugin_definition, ModuleHandlerInterface $module_handler, LanguageManagerInterface $language_manager, EntityTypeManagerInterface $entity_type_manager, KeyValueFactoryInterface $key_value, Connection $database, ConfigFactoryInterface $config_factory) {
+    parent::__construct($configuration, $plugin_id, $plugin_definition, $module_handler, $language_manager, $entity_type_manager, $key_value, $database);
     $this->configFactory = $config_factory;
   }
 
@@ -66,6 +71,7 @@ class ForumAliasType extends EntityAlias
       $container->get('module_handler'),
       $container->get('language_manager'),
       $container->get('entity_type.manager'),
+      $container->get('keyvalue'),
       $container->get('database'),
       $container->get('config.factory')
     );
