Fix format() for Python 2.6
Make str() and repr() tests deterministic