Fixing some pycharm inspection errors