various python3 compatibility updates