Fix bug in json pretty printer which broke formatting and possibly
corrupted json