Python3 fixes for unit tests.