Fixes a bug in the tags rake task.

The bug prevented proper weight calculation. Updates the tags index accordingly.