Minor bugfixes for Python 3.0