Fixed a category assignment bug