Fix module-level PEP8 spacing
Fix conditional logic