Fixes serialization of error message string.