The end of the format string was lost when substitution was used (#13)

Fixed. Added a regression test to ensure this does not come to bite
us again.