fixing Python 3 issues