Closes: #3391
The call to tmp_number.append had its arguments mixed up. Also, JSON does not allow a trailing "," after array/object members.
Fixes #294.