Fix json-write API.