yliu json trivial enhancement

two trivial commits, updated based on mlucy's kind suggestion.

Thanks.