Made some changes suggested by pylint