minor source modernisations and cleanups in Scanning.py