more fixes for py3k compatibility