Attempt at Python 3 compatibility.