diff --git a/config/install/past.settings.yml b/config/install/past.settings.yml
index 73396e9..946b7c9 100644
--- a/config/install/past.settings.yml
+++ b/config/install/past.settings.yml
@@ -6,15 +6,11 @@ shutdown_handling: true
 log_session_id: true
 max_recursion: 10
 backtrace_include:
-  # @todo Convert to string sequence:
-  # - PAST_SEVERITY_ERROR
-  # - PAST_SEVERITY_WARNING
-  # etc.
-  WATCHDOG_SEVERITY_0: 'WATCHDOG_SEVERITY_0'
-  WATCHDOG_SEVERITY_1: 'WATCHDOG_SEVERITY_1'
-  WATCHDOG_SEVERITY_2: 'WATCHDOG_SEVERITY_2'
-  WATCHDOG_SEVERITY_3: 'WATCHDOG_SEVERITY_3'
-  WATCHDOG_SEVERITY_4: 'WATCHDOG_SEVERITY_4'
-  WATCHDOG_SEVERITY_5: 'WATCHDOG_SEVERITY_5'
-  WATCHDOG_SEVERITY_6: ''
-  WATCHDOG_SEVERITY_7: ''
+  WATCHDOG_SEVERITY_EMERGENCY: true
+  WATCHDOG_SEVERITY_ALERT: true
+  WATCHDOG_SEVERITY_CRITICAL: true
+  WATCHDOG_SEVERITY_ERROR: true
+  WATCHDOG_SEVERITY_WARNING: true
+  WATCHDOG_SEVERITY_NOTICE: true
+  WATCHDOG_SEVERITY_INFO: false
+  WATCHDOG_SEVERITY_DEBUG: false
diff --git a/config/schema/past.schema.yml b/config/schema/past.schema.yml
index 7f35fba..153addb 100644
--- a/config/schema/past.schema.yml
+++ b/config/schema/past.schema.yml
@@ -29,4 +29,4 @@ past.settings:
       type: sequence
       label: 'Include watchdog severity levels from writing backtraces'
       sequence:
-        type: string
+        type: boolean
diff --git a/past.module b/past.module
index 8518480..1f5b123 100644
--- a/past.module
+++ b/past.module
@@ -5,6 +5,7 @@
  * Module file for the past project.
  */
 
+use Drupal\Component\Utility\Xss;
 use Drupal\Core\Logger\RfcLogLevel;
 use Drupal\Core\Site\Settings;
 use Drupal\Core\Url;
@@ -13,6 +14,7 @@ use Drupal\past\PastEventNull;
 
 /**
  * Severities correspond to Log message severity from WATCHDOG.
+ *
  * @see bootstrap.inc
  */
 const PAST_SEVERITY_EMERGENCY = 0;
@@ -175,22 +177,6 @@ function past_form_system_logging_settings_alter(&$form, &$form_state) {
 }
 
 /**
- * Provides the default enabled watchdog severities to include in backtrace.
- *
- * @return array
- *   Keys are Watchdog severity levels, values are unset.
- */
-function _past_watchdog_severity_defaults() {
-  return drupal_map_assoc(array(
-    'WATCHDOG_SEVERITY_' . RfcLogLevel::EMERGENCY,
-    'WATCHDOG_SEVERITY_' . RfcLogLevel::ALERT,
-    'WATCHDOG_SEVERITY_' . RfcLogLevel::CRITICAL,
-    'WATCHDOG_SEVERITY_' . RfcLogLevel::ERROR,
-    'WATCHDOG_SEVERITY_' . RfcLogLevel::NOTICE,
-  ));
-}
-
-/**
  * Ported format_backtrace from D8 and customized.
  *
  * @param string $severity_level
@@ -205,7 +191,12 @@ function _past_watchdog_severity_defaults() {
 function _past_get_formatted_backtrace($severity_level, $slice = 5) {
   $config = \Drupal::config('past.settings');
   $log_backtrace = $config->get('backtrace_include');
-  $severity_keyvalue = 'WATCHDOG_SEVERITY_' . $severity_level;
+  if (!is_null($severity_level)) {
+    $severity_keyvalue = 'WATCHDOG_SEVERITY_' . strtoupper(RfcLogLevel::getLevels()[$severity_level]);
+  }
+  else {
+    $severity_keyvalue = NULL;
+  }
   if (!is_null($severity_level) && empty($log_backtrace[$severity_keyvalue])) {
     return NULL;
   }
@@ -236,7 +227,7 @@ function _past_get_formatted_backtrace($severity_level, $slice = 5) {
     else {
       foreach ($trace['args'] as $arg) {
         if (is_scalar($arg)) {
-          $call['args'][] = is_string($arg) ? '\'' . filter_xss($arg) . '\'' : $arg;
+          $call['args'][] = is_string($arg) ? '\'' . Xss::filter($arg) . '\'' : $arg;
         }
         else {
           $call['args'][] = ucfirst(gettype($arg));
@@ -258,7 +249,7 @@ function _past_get_formatted_backtrace($severity_level, $slice = 5) {
  * @return array
  *   The prepared argument array.
  */
-function _past_error_array_to_event($error) {
+function _past_error_array_to_event(array $error) {
   // Make the output of the exception nicer (remove special chars).
   if (isset($error['%type']) && isset($error['%function']) && isset($error['%file']) && isset($error['%line']) && isset($error['severity_level'])) {
     $context = array();
diff --git a/src/Form/PastSettingsForm.php b/src/Form/PastSettingsForm.php
index e0f7c07..2c3e4a4 100644
--- a/src/Form/PastSettingsForm.php
+++ b/src/Form/PastSettingsForm.php
@@ -80,9 +80,20 @@ class PastSettingsForm extends ConfigFormBase {
       '#description' => t('When enabled, Past will take watchdog log entries. <em>To avoid redundancy, you can turn off the database logging module.</em>'),
     );
 
+    $options = $config->get('backtrace_include');
+    $included_severity_levels = array();
+    foreach (RfcLogLevel::getLevels() as $level => $value) {
+      $severity_keyvalue = 'WATCHDOG_SEVERITY_' . strtoupper($value);
+      if ($options[$severity_keyvalue]) {
+        $included_severity_levels[] = "" . $level;
+      }
+      else {
+        $included_severity_levels[] = 0;
+      }
+    }
     $form['watchdog']['backtrace_include'] = array(
       '#type' => 'checkboxes',
-      '#default_value' => $config->get('backtrace_include'),
+      '#default_value' => $included_severity_levels,
       '#options' => RfcLogLevel::getLevels(),
       '#title' => t('Watchdog severity levels from writing backtraces'),
       '#description' => t('A backtrace is logged for all severities that are checked.'),
@@ -111,9 +122,14 @@ class PastSettingsForm extends ConfigFormBase {
    */
   public function submitForm(array &$form, FormStateInterface $form_state) {
     $included_severity_levels = array();
-    foreach ($form_state->getValue('backtrace_include') as $level => $enabled) {
-      if ($enabled) {
-        $included_severity_levels[] = $level;
+    $options = $form_state->getValue('backtrace_include');
+    foreach (RfcLogLevel::getLevels() as $level => $value) {
+      $severity_keyvalue = 'WATCHDOG_SEVERITY_' . strtoupper($value);
+      if ($options[$level] !== 0) {
+        $included_severity_levels[$severity_keyvalue] = TRUE;
+      }
+      else {
+        $included_severity_levels[$severity_keyvalue] = FALSE;
       }
     }
     $this->config('past.settings')
