Fix bugs, add drupal 6 support