added null checks & more unit tests for the json_tuple function -- issue #1377