diff --git a/core/includes/form.inc b/core/includes/form.inc
index b9180b2..a4df071 100644
--- a/core/includes/form.inc
+++ b/core/includes/form.inc
@@ -2994,22 +2994,22 @@ function form_process_password_confirm($element) {
     '#type' => 'password',
     '#title' => t('Password'),
     '#value' => empty($element['#value']) ? NULL : $element['#value']['pass1'],
-    '#required' => $element['#required'],
     '#attributes' => array('class' => array('password-field')),
   );
   $element['pass2'] =  array(
     '#type' => 'password',
     '#title' => t('Confirm password'),
     '#value' => empty($element['#value']) ? NULL : $element['#value']['pass2'],
-    '#required' => $element['#required'],
     '#attributes' => array('class' => array('password-confirm')),
   );
   $element['#element_validate'] = array('password_confirm_validate');
   $element['#tree'] = TRUE;
 
-  if (isset($element['#size'])) {
-    $element['pass1']['#size'] = $element['pass2']['#size'] = $element['#size'];
-  }
+  // Merge in attributes from the parent element.
+  $attribute_keys = drupal_map_assoc('#required', '#size', '#maxlength', '#placeholder', '#pattern');
+  $attributes = array_intersect_key($element, $attributes);
+  $element['pass1'] += $attributes;
+  $element['pass2'] += $attributes;
 
   return $element;
 }
diff --git a/core/modules/block/custom_block/custom_block.module b/core/modules/block/custom_block/custom_block.module
index 1bcf414..1448f41 100644
--- a/core/modules/block/custom_block/custom_block.module
+++ b/core/modules/block/custom_block/custom_block.module
@@ -164,6 +164,9 @@ function custom_block_type_load($id) {
  *   A CustomBlock object or FALSE if the requested $id does not exist.
  */
 function custom_block_load($id) {
+  if (!is_numeric($id)) {
+    return FALSE;
+  }
   return entity_load('custom_block', $id);
 }
 
diff --git a/core/modules/field_ui/field_ui.admin.inc b/core/modules/field_ui/field_ui.admin.inc
index eda59c8..0e4126b 100644
--- a/core/modules/field_ui/field_ui.admin.inc
+++ b/core/modules/field_ui/field_ui.admin.inc
@@ -375,9 +375,11 @@ function field_ui_formatter_options($field_type = NULL) {
   $options = &drupal_static(__FUNCTION__);
 
   if (!isset($options)) {
-    $field_types = field_info_field_types();
     $options = array();
-    foreach (field_info_formatter_types() as $name => $formatter) {
+    $field_types = field_info_field_types();
+    $formatter_types = field_info_formatter_types();
+    uasort($formatter_types, 'drupal_sort_weight');
+    foreach ($formatter_types as $name => $formatter) {
       foreach ($formatter['field_types'] as $formatter_field_type) {
         // Check that the field type exists.
         if (isset($field_types[$formatter_field_type])) {
