In a few places we were passing a constructed string to a printf-like
function as its format argument. This could have been problematic if
the constructed string had contained a % (for example due to that
character occuring in a variable label). This change avoids those
situations.