Fix check of right_script? and comment to_json.