Fixed minor bug in Scanner
More fixes in Scanner and simple visualizer