FixCommand - stop corrupting xml/json format

Fixes #826

Ref #839