Fix |cleanup| regression in the viewer
Merge pull request #5374 from Snuffleupagus/viewer-cleanup-regression

Fix |cleanup| regression in the viewer