diff --git a/block_example/block_example.module b/block_example/block_example.module
index 26792ed..1c3b013 100755
--- a/block_example/block_example.module
+++ b/block_example/block_example.module
@@ -153,6 +153,7 @@ function block_example_contents($which_block) {
       // block configuration or, if none has set, a default value.
       // Block content can be returned in two formats: renderable arrays
       // (as here) are preferred though a simple string will work as well.
+      // Block content created through the UI defaults to a string.
       return array('#markup' => variable_get('block_example_string',  t('A default value. This block was created at %time', array('%time' => date('c')))));
     case 'example_empty':
       // It is possible that a block not have any content, since it is
@@ -200,27 +201,39 @@ function block_example_block_list_alter(&$blocks) {
  *
  * In addition, instead of hook_block_view_alter(), which is called for all
  * blocks, you can also use hook_block_view_MODULE_DELTA_alter() to alter a
- * specific block.
- *
- * We are going to uppercase the title of any block if the string "magic string"
- * is encountered in the content. If we were changing only our block using
- * hook_block_view_MODULE_DELTA_alter to do this, we would have used the
- * function:
+ * specific block. To change only our block using
+ * hook_block_view_MODULE_DELTA_alter, we would use the function:
  * block_example_block_view_block_example_example_configurable_text_alter()
  *
- * To demonstrate the effect of this hook, you can use the
- * 'configurable_text_string' block created by this module and add the
- * text 'magic string' into the configuration.
+ * We are going to uppercase the title of any block if the string "magic string"
+ * is encountered in the content. To demonstrate the effect of this hook, create
+ * a new block with a lower case title and the string 'magic string' included in
+ * the block body, or add the text to the 'configurable_text_string' block.
  */
 function block_example_block_view_alter(&$data, $block) {
-  // Verify the we have raw text content
-  if (!isset($data['content']) || !is_string($data['content'])) {
+  // Our block needs special handling, since content takes the form of a
+  // renderable array.
+  if($block->module == 'block_example') {
+    if (strstr($data['content']['#markup'], 'magic string')) {
+      // This will uppercase the default title.
+      $data['subject'] = isset($data['subject']) ? drupal_strtoupper($data['subject']) : '';
+      // This will uppercase a title set in the UI.
+      $block->title = isset($block->title) ? drupal_strtoupper($block->title) : '';
+    }
+  }
+  // Otherwise, verify the we have raw text content.
+  else if (!isset($data['content']) || !is_string($data['content'])) {
     return;
   }
-
+  else {
   // If the content contains the string: 'magic string', uppercase the title.
-  if (strstr($data['content'], 'magic string')) {
-    $data['subject'] = isset($data['subject']) ? drupal_strtoupper($data['subject']) : '';
+    if (strstr($data['content'], 'magic string')) {
+      // This will work for blocks created programmatically if content is
+      // returned as a string.
+      $data['subject'] = isset($data['subject']) ? drupal_strtoupper($data['subject']) : '';
+      // This works for blocks created in the UI.
+      $block->title = isset($block->title) ? drupal_strtoupper($block->title) : '';
+    }
   }
 }
 /**
diff --git a/block_example/block_example.test b/block_example/block_example.test
index 389384e..7472359 100644
--- a/block_example/block_example.test
+++ b/block_example/block_example.test
@@ -70,7 +70,7 @@ class BlockExampleTestCase extends DrupalWebTestCase {
     // Verify that new content is shown and the title is uppercase
     $this->drupalGet('/');
     $this->assertRaw( $string, t('Content of configurable text block successfully verified.'));
-    $this->assertText(t('Title of first block (example_configurable_text)'), t('hook_block_view_alter implementation successfully verified.'));
+    $this->assertText(t('TITLE OF FIRST BLOCK (EXAMPLE_CONFIGURABLE_TEXT)'), t('hook_block_view_alter implementation successfully verified.'));
 
     // Verify that search block is at the bottom of the region.
 
