Fix Python 3 compatibility.

Hi

This commit is to fix more Python 3 compatibility.