NullReferenceException fixes + message serialization.