More python3 fixes, mostly unittest-related