Misc changes to support python3.
Fix the travis build for python3.