Switching to JSON encoding for serialization.