Fixed a 2.2-series glitch (#11418). Fixed a situation about orphaned categories.