Fixing bugs in scan JSON output