Fix formatting string for UnexpectedError (fixes testsuite)
Add __attribute__(format) for newly-introduced formatting functions