Multiple typo fixes and rephrasings.
Multiple code fixes, converting to python3 code.
Multiple code typos.