fix error msg formatting bugs (introduced in e445f632)

Error was:
    TypeError: not all arguments converted during string formatting

Code was like this:
    'value %s' + ' is bad' % val

Fix:
    ('value %s' + ' is bad') % val