Update scanner.py

Made a few fixes... still blind.
No real comments until it's tested.