fixed Python 3 issues