Fix from http://drupal.org/node/1986098