new: various compatibility fixes for python3.