Some more python3 compatibility code