Should use %r where the old code used repr().
There's a couple other occurances of this issue below.