fixed comparing with '==' to True and added minor PEP8 edits.
Merge pull request #219 from valorien/patch-1

fixed comparing with '==' to True and added minor PEP8 edits.