Python 3 test fixes