Porting changes from drupal.org