Fix output from Schema::toPTree() to be valid JSON without duplicate keys.