Fix error serialization.