Python 3 update

Updates for Python 3 support.