Better handling of malformed format strings