Many small cosmetic fixes (pep8 and so on).