Fix metadata break when any of the paratemers to the Format function are null.

Here's the proper fix. Example of failure can be seen in the in-built Swagger ResourceRequest which will generate an error.