Fixes for py2.6