Fix JSON serialization