=== modified file modules/comment/comment.module 
--- modules/comment/comment.module	2010-08-30 11:28:46.000000000 +0530
+++ modules/comment/comment.module	2010-08-31 22:52:41.000000000 +0530
@@ -2564,7 +2564,7 @@ function comment_ranking() {
         'on' => 'node_comment_statistics.nid = i.sid',
       ),
       // Inverse law that maps the highest reply count on the site to 1 and 0 to 0.
-      'score' => '2.0 - 2.0 / (1.0 + node_comment_statistics.comment_count * CAST(:scale AS DECIMAL))',
+      'score' => '2.0 - 2.0 / (1.0 + node_comment_statistics.comment_count * :scale)',
       'arguments' => array(':scale' => variable_get('node_cron_comments_scale', 0)),
     ),
   );
=== modified file modules/node/node.module 
--- modules/node/node.module	2010-08-30 11:28:46.000000000 +0530
+++ modules/node/node.module	2010-08-31 22:52:41.000000000 +0530
@@ -2534,6 +2534,9 @@ function node_update_index() {
   foreach ($result as $node) {
     _node_index_node($node);
   }
+  
+  module_invoke('comment', 'update_index');
+  module_invoke('statistics', 'update_index');
 }
 
 /**
=== modified file modules/statistics/statistics.module 
--- modules/statistics/statistics.module	2010-08-30 11:28:46.000000000 +0530
+++ modules/statistics/statistics.module	2010-08-31 22:52:41.000000000 +0530
@@ -409,7 +409,7 @@ function statistics_ranking() {
           'on' => 'node_counter.nid = i.sid',
         ),
         // Inverse law that maps the highest view count on the site to 1 and 0 to 0.
-        'score' => '2.0 - 2.0 / (1.0 + node_counter.totalcount * CAST(:scale AS DECIMAL))',
+        'score' => '2.0 - 2.0 / (1.0 + node_counter.totalcount * :scale)',
         'arguments' => array(':scale' => variable_get('node_cron_views_scale', 0)),
       ),
     );
