Fixed py3k compatibility