Fix bugs of MessageServer and MessageDecoder.