Added tests to prevent crash when decoding wrong or incomplete messasges.