I'm guessing your real problem is that you hve some broken categories. Run the category checker in the admin panel, and also verify in the database that all subcategories have their corresponding root categories.
--Philip
Links 2.0 moderator
--Philip
Links 2.0 moderator