Fixing tool so that it prints out valid json

Fixing tool so that it prints out valid json