Some Python3 related fixes.

Nothing fancy here.