Fix the last of the unit tests.
Fix more python3 compatibility.