Correct maximum depth of visible categories.