Fixed a few things for python3.