Fix changing view type of categories.
When the view type of a category is first changed, and then changed back to the original value, the second change would not be applied. Caught by -Wself-assign-field.