Fix imports for python3 compatibility.