fix some issues found by pycharm