Fix py3k compatibility