Error corrections suggested by pychecker