Minor fixes in scanner