Fix typo

While I'm here clean up the code (PEP8).