Added debug_json option, issue #145