Avoid spurious []
on JSON output in some cases
#1528
+56
−28
Merged