Made visualizer more robust.