Fix missing backticks and parentheses in error messages; fixes #7734

Patch from monoidal