diff --git a/core/lib/Drupal.php b/core/lib/Drupal.php
index fa7f204..dee7c9d 100644
--- a/core/lib/Drupal.php
+++ b/core/lib/Drupal.php
@@ -88,10 +88,10 @@ public static function database() {
   }
 
   /**
-  * Returns the locking layer instance.
-  *
-  * @return \Drupal\Core\Lock\LockBackendInterface
-  */
+   * Returns the locking layer instance.
+   *
+   * @return \Drupal\Core\Lock\LockBackendInterface
+   */
   public static function lock() {
     return static::$container->get('lock');
   }
diff --git a/core/modules/contact/lib/Drupal/contact/MessageFormController.php b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
index 0221d01..c4352cf 100644
--- a/core/modules/contact/lib/Drupal/contact/MessageFormController.php
+++ b/core/modules/contact/lib/Drupal/contact/MessageFormController.php
@@ -191,7 +191,7 @@ public function save(array $form, array &$form_state) {
       drupal_mail('contact', 'page_autoreply', $sender->mail, $language_interface->langcode, $params);
     }
 
-    Drupal::service('flood')->register('contact', config('contact.settings')->get('flood.interval'));
+    \Drupal::service('flood')->register('contact', config('contact.settings')->get('flood.interval'));
     if ($message->category) {
       watchdog('contact', '%sender-name (@sender-from) sent an e-mail regarding %category.', array(
         '%sender-name' => $sender->name,
diff --git a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
index fd5dd75..bdc98ef 100644
--- a/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
+++ b/core/modules/contact/lib/Drupal/contact/Tests/ContactSitewideTest.php
@@ -207,7 +207,7 @@ function testAutoReply() {
     // We are testing the auto-reply, so there should be one e-mail going to the sender.
     $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email));
     $this->assertEqual(count($captured_emails), 1);
-    $this->assertEqual($captured_emails[0]['body'], drupal_html_to_text($foo_autoreply));
+    $this->assertEqual(trim($captured_emails[0]['body']), trim(drupal_html_to_text($foo_autoreply)));
 
     // Test the auto-reply for category 'bar'.
     $email = $this->randomName(32) . '@example.com';
@@ -216,7 +216,7 @@ function testAutoReply() {
     // Auto-reply for category 'bar' should result in one auto-reply e-mail to the sender.
     $captured_emails = $this->drupalGetMails(array('id' => 'contact_page_autoreply', 'to' => $email));
     $this->assertEqual(count($captured_emails), 1);
-    $this->assertEqual($captured_emails[0]['body'], drupal_html_to_text($bar_autoreply));
+    $this->assertEqual(trim($captured_emails[0]['body']), trim(drupal_html_to_text($bar_autoreply)));
 
     // Verify that no auto-reply is sent when the auto-reply field is left blank.
     $email = $this->randomName(32) . '@example.com';
diff --git a/core/modules/system/lib/Drupal/system/Tests/System/FloodTest.php b/core/modules/system/lib/Drupal/system/Tests/System/FloodTest.php
index 369e31a..6af396b 100644
--- a/core/modules/system/lib/Drupal/system/Tests/System/FloodTest.php
+++ b/core/modules/system/lib/Drupal/system/Tests/System/FloodTest.php
@@ -30,21 +30,21 @@ function testCleanUp() {
     $name = 'flood_test_cleanup';
 
     // Register expired event.
-    $flood_manager = \Drupal::service('flood');
-    $flood_manager->register($name, $window_expired);
+    $flood = \Drupal::service('flood');
+    $flood->register($name, $window_expired);
     // Verify event is not allowed.
-    $this->assertFalse($flood_manager->isAllowed($name, $threshold));
+    $this->assertFalse($flood->isAllowed($name, $threshold));
     // Run cron and verify event is now allowed.
     $this->cronRun();
-    $this->assertTrue($flood_manager->isAllowed($name, $threshold));
+    $this->assertTrue($flood->isAllowed($name, $threshold));
 
     // Register unexpired event.
-    $flood_manager->register($name);
+    $flood->register($name);
     // Verify event is not allowed.
-    $this->assertFalse($flood_manager->isAllowed($name, $threshold));
+    $this->assertFalse($flood->isAllowed($name, $threshold));
     // Run cron and verify event is still not allowed.
     $this->cronRun();
-    $this->assertFalse($flood_manager->isAllowed($name, $threshold));
+    $this->assertFalse($flood->isAllowed($name, $threshold));
   }
 
   /**
diff --git a/core/modules/translation_entity/translation_entity.module b/core/modules/translation_entity/translation_entity.module
index ac00322..a413f0a 100644
--- a/core/modules/translation_entity/translation_entity.module
+++ b/core/modules/translation_entity/translation_entity.module
@@ -868,11 +868,21 @@ function translation_entity_field_info_alter(&$info) {
 function translation_entity_field_attach_presave(EntityInterface $entity) {
   if (translation_entity_enabled($entity->entityType(), $entity->bundle())) {
     $attributes = drupal_container()->get('request')->attributes;
-    drupal_container()->get('translation_entity.synchronizer')->synchronizeFields($entity, $attributes->get('working_langcode'), $attributes->get('source_langcode'));
+    translation_entity_synchronizer()->synchronizeFields($entity, $attributes->get('working_langcode'), $attributes->get('source_langcode'));
   }
 }
 
 /**
+ * Returns an instance of the field translation synchronizer service.
+ *
+ * @return \Drupal\translation_entity\FieldTranslationSynchronizerInterface
+ *   An object implementing the field translation synchronizer interface.
+ */
+function translation_entity_synchronizer() {
+  return Drupal::service('translation_entity.synchronizer');
+}
+
+/**
  * Implements hook_element_info_alter().
  */
 function translation_entity_element_info_alter(&$type) {
diff --git a/core/modules/user/user.module b/core/modules/user/user.module
index 736a0a8..250cc75 100644
--- a/core/modules/user/user.module
+++ b/core/modules/user/user.module
@@ -1330,14 +1330,14 @@ function user_login_name_validate($form, &$form_state) {
 function user_login_authenticate_validate($form, &$form_state) {
   $password = trim($form_state['values']['pass']);
   $flood_config = config('user.flood');
-  $flood_manager = Drupal::service('flood');
+  $flood = Drupal::service('flood');
   if (!empty($form_state['values']['name']) && !empty($password)) {
     // Do not allow any login from the current user's IP if the limit has been
     // reached. Default is 50 failed attempts allowed in one hour. This is
     // independent of the per-user limit to catch attempts from one IP to log
     // in to many different user accounts.  We have a reasonably high limit
     // since there may be only one apparent IP for all users at an institution.
-    if (!$flood_manager->isAllowed('user.failed_login_ip', $flood_config->get('ip_limit'), $flood_config->get('ip_window'))) {
+    if (!$flood->isAllowed('user.failed_login_ip', $flood_config->get('ip_limit'), $flood_config->get('ip_window'))) {
       $form_state['flood_control_triggered'] = 'ip';
       return;
     }
@@ -1358,7 +1358,7 @@ function user_login_authenticate_validate($form, &$form_state) {
 
       // Don't allow login if the limit for this user has been reached.
       // Default is to allow 5 failed attempts every 6 hours.
-      if (!$flood_manager->isAllowed('user.failed_login_user', $flood_config->get('user_limit'), $flood_config->get('user_window'), $identifier)) {
+      if (!$flood->isAllowed('user.failed_login_user', $flood_config->get('user_limit'), $flood_config->get('user_window'), $identifier)) {
         $form_state['flood_control_triggered'] = 'user';
         return;
       }
@@ -1378,13 +1378,13 @@ function user_login_authenticate_validate($form, &$form_state) {
  */
 function user_login_final_validate($form, &$form_state) {
   $flood_config = config('user.flood');
-  $flood_manager = Drupal::service('flood');
+  $flood = Drupal::service('flood');
   if (empty($form_state['uid'])) {
     // Always register an IP-based failed login event.
-    $flood_manager->register('user.failed_login_ip', $flood_config->get('ip_window'));
+    $flood->register('user.failed_login_ip', $flood_config->get('ip_window'));
     // Register a per-user failed login event.
     if (isset($form_state['flood_control_user_identifier'])) {
-      $flood_manager->register('user.failed_login_user', $flood_config->get('user_window'), $form_state['flood_control_user_identifier']);
+      $flood->register('user.failed_login_user', $flood_config->get('user_window'), $form_state['flood_control_user_identifier']);
     }
 
     if (isset($form_state['flood_control_triggered'])) {
@@ -1404,7 +1404,7 @@ function user_login_final_validate($form, &$form_state) {
   elseif (isset($form_state['flood_control_user_identifier'])) {
     // Clear past failures for this user so as not to block a user who might
     // log in and out more than once in an hour.
-    $flood_manager->clear('user.failed_login_user', $form_state['flood_control_user_identifier']);
+    $flood->clear('user.failed_login_user', $form_state['flood_control_user_identifier']);
   }
 }
 
