PEP-8 and assorted pycharm inspection fixes