Fix category display issues in the element tree

As per #11479, submitting element tree fixes to develop branch.