more fixes to Viewer.cpp