minor pep8 and a wrong for loop variable bugfix.