Updated to latest Python syntax

Also fixed some errors, tabs and spaces were used in the same line and
one ':' was missing, didn't run.