Make compatible with python3.