Another attempt to achieve python 3 compatibility.