update test and code to be python3 compatible.