Fix error messager JSON serialization.