drupal integration, plus minor fixes