Attempt to fix python 3 compatibility.