Changes to support JSON output.