fixed some issues found by pycharm