fix bugs in printing JSON/YAML