Make category editing more robust.