Fixes #4619: Improve json prettifier