--- tagadelic.module.orig	2009-05-13 18:56:12.000000000 +0200
+++ tagadelic.module	2009-06-24 02:54:25.000000000 +0200
@@ -210,7 +210,8 @@
  */
 function tagadelic_get_weighted_tags($vids, $steps = 6, $size = 60) {
   // build the options so we can cache multiple versions
-  $options = implode($vids) .'_'. $steps .'_'. $size;
+  global $language;
+  $options = implode('_',$vids) . '_' . $language->language . '_' . $steps . '_' . $size;
   
   // Check if the cache exists
   $cache_name = 'tagadelic_cache_'. $options;
@@ -225,7 +226,7 @@
     if (!is_array($vids) || count($vids) == 0) {
       return array();
     }
-    $result = db_query_range('SELECT COUNT(*) AS count, d.tid, d.name, d.vid, d.description FROM {term_data} d INNER JOIN {term_node} n ON d.tid = n.tid WHERE d.vid IN ('. substr(str_repeat('%d,', count($vids)), 0, -1) .') GROUP BY d.tid, d.name, d.vid ORDER BY count DESC', $vids, 0, $size);
+    $result = db_query_range(db_rewrite_sql('SELECT COUNT(*) AS count, td.tid, td.vid, td.name, td.description FROM {term_data} td INNER JOIN {term_node} tn ON td.tid = tn.tid INNER JOIN {node} n ON tn.vid = n.vid WHERE td.vid IN ('. db_placeholders($vids) .') GROUP BY td.tid, td.vid, td.name, td.description HAVING COUNT(*) > 0 ORDER BY count DESC'), $vids, 0, $size);
     
     $tags = tagadelic_build_weighted_tags($result, $steps);
 
