fixed a bug with drupal-mode init and added more local vars.