Fixed undefined optional strings serialized to "undefined"

Similar to the other fix, found out that undefined fields were serialized to the "undefined" string.