Fixed py3 support for tests