Aka: Use %q converter instead of %r for logging (escapes % in expression).
Aka: Fix previous commit.
Aka: Fix crash when logging (on Python 2).