Fixed formatString to work with null