Fix py3k compatibility issues.