Made backend data manipulation in test more stable

(it was failing on some machines because primitiveInt came last and lacked a trailing
comma the JSONObject's string representation)