diff --git a/core/modules/comment/lib/Drupal/comment/CommentStorageController.php b/core/modules/comment/lib/Drupal/comment/CommentStorageController.php
index 8cd1a53..d8ac913 100644
--- a/core/modules/comment/lib/Drupal/comment/CommentStorageController.php
+++ b/core/modules/comment/lib/Drupal/comment/CommentStorageController.php
@@ -137,6 +137,9 @@ public function baseFieldDefinitions() {
       'label' => t('Subject'),
       'description' => t('The comment title or subject.'),
       'type' => 'string_field',
+      'property_constraints' => array(
+        'value' => array('Length' => array('max' => 64)),
+      ),
     );
     $properties['uid'] = array(
       'label' => t('User ID'),
@@ -152,11 +155,14 @@ public function baseFieldDefinitions() {
       'description' => t("The comment author's name."),
       'type' => 'string_field',
       'settings' => array('default_value' => ''),
+      'property_constraints' => array(
+        'value' => array('Length' => array('max' => 60)),
+      ),
     );
     $properties['mail'] = array(
       'label' => t('e-mail'),
       'description' => t("The comment author's e-mail address."),
-      'type' => 'string_field',
+      'type' => 'email_field',
     );
     $properties['homepage'] = array(
       'label' => t('Homepage'),
diff --git a/core/modules/comment/lib/Drupal/comment/Tests/CommentValidationTest.php b/core/modules/comment/lib/Drupal/comment/Tests/CommentValidationTest.php
new file mode 100644
index 0000000..2bf7fed
--- /dev/null
+++ b/core/modules/comment/lib/Drupal/comment/Tests/CommentValidationTest.php
@@ -0,0 +1,79 @@
+<?php
+
+/**
+ * @file
+ * Contains \Drupal\comment\Tests\CommentValidationTest.
+ */
+
+namespace Drupal\comment\Tests;
+
+use Drupal\simpletest\DrupalUnitTestBase;
+
+/**
+ * Tests comment validation constraints.
+ */
+class CommentValidationTest extends DrupalUnitTestBase {
+
+  /**
+   * Modules to enable.
+   *
+   * @var array
+   */
+  public static $modules = array('comment', 'node', 'entity', 'field', 'text', 'field_sql_storage', 'user');
+
+  public static function getInfo() {
+    return array(
+      'name' => 'Comment Validation',
+      'description' => 'Tests the comment validation constraints.',
+      'group' => 'Comment',
+    );
+  }
+
+  public function setUp() {
+    parent::setUp();
+    $this->installSchema('node', 'node');
+    $this->installSchema('node', 'node_field_data');
+    $this->installSchema('node', 'node_field_revision');
+    $this->installSchema('comment', 'node_comment_statistics');
+    $this->installSchema('user', 'users');
+    $this->installSchema('user', 'users_roles');
+    user_install();
+  }
+
+  /**
+   * Tests the comment validation constraints.
+   */
+  public function testValidation() {
+    $node = entity_create('node', array(
+      'type' => 'page',
+      'title' => 'test',
+    ));
+    $node->save();
+
+    $comment = entity_create('comment', array('nid' => $node->id()));
+    $violations = $comment->validate();
+    $this->assertEqual(count($violations), 0, 'No violations when validating a default comment.');
+
+    $comment->set('subject', $this->randomString(65));
+    $violations = $comment->validate();
+    $this->assertEqual(count($violations), 1, 'Violation found when subject is too long.');
+    $violation = $violations->get(0);
+    $this->assertEqual($violation->getPropertyPath(), 'subject.0.value');
+
+    // Make the subject valid.
+    $comment->set('subject', $this->randomString());
+    $comment->set('name', $this->randomString(61));
+    $violations = $comment->validate();
+    $this->assertEqual(count($violations), 1, 'Violation found when name is too long.');
+    $violation = $violations->get(0);
+    $this->assertEqual($violation->getPropertyPath(), 'name.0.value');
+
+    // Make the name valid.
+    $comment->set('name', $this->randomString());
+    $comment->set('mail', 'invalid');
+    $violations = $comment->validate();
+    $this->assertEqual(count($violations), 1, 'Violation found when email is invalid');
+    $violation = $violations->get(0);
+    $this->assertEqual($violation->getPropertyPath(), 'mail.0.value');
+  }
+}
diff --git a/core/modules/node/lib/Drupal/node/NodeStorageController.php b/core/modules/node/lib/Drupal/node/NodeStorageController.php
index c3ccc3c..5efde56 100644
--- a/core/modules/node/lib/Drupal/node/NodeStorageController.php
+++ b/core/modules/node/lib/Drupal/node/NodeStorageController.php
@@ -160,7 +160,10 @@ public function baseFieldDefinitions() {
       'label' => t('User ID'),
       'description' => t('The user ID of the node author.'),
       'type' => 'entity_reference_field',
-      'settings' => array('target_type' => 'user'),
+      'settings' => array(
+        'target_type' => 'user',
+        'default_value' => 0,
+      ),
     );
     $properties['status'] = array(
       'label' => t('Publishing status'),
