fix Category#build_subcats
fix some bugs