python3 compatibility changes