Fixes python3 compatibility.