Add Python 3 compatibility.