Fixed export to JSON