Fix serialization of array with empty object into JSON