Phase I: fixed pychecker warnings