Another fix to JSON generation