json_cpy & json_dup off by one error fixed