Some changes to meet the flake8 rules
Testcases failed because one of the new tests fiddled around with the plugins singleton. Fixed this.