Fix JSON serialization.