make_json: fix some bugs