CMS-3593 Re-expanding closed tree nodes must remember what was expanded before closing
Removed unnecessary casting.