correct Python 3 issues