Fix broken python 3 compatibility.