Reusing formatting code IcccmWmStateFormatter.
Fixing double-free of errors.