fixing python 3.x problems found by new unittests