Fix 2.6 compatibility
Fix Python 3.x compatibility