Fix Python 2.6 compatibility
Fix Python 3.2 compatibility