Fixed two little issues with python3 compatibility.