Fix undefined variable error if format is not set