Fixed JSON generation