fixes for python 3, and pyflakes