I think these two assignments should be done  in `removeCustomViewer()`.