Fixed some pycharm inspection warnings