Issues #1987602, #1978894, #1978892: Resolve issues from code review by
tstoeckler.

http://drupal.org/node/1987602#comment-7443248