python3.2 compatibility fixes