Some syntax fixes for Python 3.