Fixed bug in SurfaceViewer utils.