Minor bug fixes and PEP8 corrections.
Some PEP8 corrections.