diff --git a/includes/common.inc b/includes/common.inc
index 0a3ed73..8e16f90 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -5570,7 +5570,7 @@ function drupal_render(&$elements) {
 
   // If #markup is not empty, set #type. This allows to specify just #markup on
   // an element without setting #type.
-  if (!empty($elements['#markup']) && !isset($elements['#type'])) {
+  if (isset($elements['#markup']) && ($elements['#markup'] !== '') && !isset($elements['#type'])) {
     $elements['#type'] = 'markup';
   }
 
diff --git a/includes/form.inc b/includes/form.inc
index c0163ca..330a623 100644
--- a/includes/form.inc
+++ b/includes/form.inc
@@ -3923,7 +3923,7 @@ function theme_form_element_label($variables) {
   $t = get_t();
 
   // If title and required marker are both empty, output no label.
-  if (empty($element['#title']) && empty($element['#required'])) {
+  if (isset($element['#title']) && ($element['#title'] === '') && empty($element['#required'])) {
     return '';
   }
 
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 0596bde..58094fb 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -968,7 +968,7 @@ function user_admin_role($form, $form_state, $role) {
  * Form validation handler for the user_admin_role() form.
  */
 function user_admin_role_validate($form, &$form_state) {
-  if (!empty($form_state['values']['name'])) {
+  if (isset($form_state['values']['name']) && ($form_state['values']['name'] !== '')) {
     if ($form_state['values']['op'] == t('Save role')) {
       $role = user_role_load_by_name($form_state['values']['name']);
       if ($role && $role->rid != $form_state['values']['rid']) {
diff --git a/modules/user/user.test b/modules/user/user.test
index 3c453a8..ea28d87 100644
--- a/modules/user/user.test
+++ b/modules/user/user.test
@@ -1823,6 +1823,14 @@ class UserRoleAdminTestCase extends DrupalWebTestCase {
     $this->assertNoLinkByHref("admin/people/permissions/roles/edit/{$role->rid}", t('Role edit link removed.'));
     $this->assertFalse(user_role_load_by_name($role_name), t('A deleted role can no longer be loaded.'));
 
+    // Test adding an edge case role. (String "0" is a valid role name)
+    $role_name = '0';
+    $edit = array('name' => $role_name);
+    $this->drupalPost('admin/people/permissions/roles', $edit, t('Add role'));
+    $this->assertText(t('The role has been added.'), t('The role has been added.'));
+    $role = user_role_load_by_name($role_name);
+    $this->assertTrue(is_object($role), t('The role was successfully retrieved from the database.'));
+
     // Make sure that the system-defined roles cannot be edited via the user
     // interface.
     $this->drupalGet('admin/people/permissions/roles/edit/' . DRUPAL_ANONYMOUS_RID);
