Fix bug introduced by last commit and some minor PEP8 stuff