Cleaned up a repr() hack that caused problems on Python3.