Fixed some bugs.
Category sorting.