Fixing a bug and several other flake8 problems
Merge pull request #367 from adamrp/ena_fix

Bug fix(es) and flake8 fixes