Fix: gadgets.json.stringify generates invalid and unparsable string if a value in an object is undefined