Fixed JSON encoding.