const int right_byte
 ) const
 {
+    BOOST_ASSERT( ( 0 <= left_byte ) && ( left_byte < static_cast<int>(PayloadSizeInBytes) ) );
+    BOOST_ASSERT( ( 0 <= right_byte ) && ( right_byte < static_cast<int>(PayloadSizeInBytes) ) );
+    BOOST_ASSERT( left_byte < right_byte );
+    BOOST_ASSERT( ( right_byte - left_byte ) == sizeof(uint16_t) );
+
     uint32_t value = ( Payload[ left_byte ] << 8 ) + Payload[ right_byte ];
 
     BOOST_ASSERT( value <= numeric_limits<uint16_t>::max() );
         const uint16_t value
 )
 {
+    BOOST_ASSERT( ( 0 < left_byte ) && ( left_byte < static_cast<int>(PayloadSizeInBytes) ) );
+    BOOST_ASSERT( ( 0 < right_byte ) && ( right_byte < static_cast<int>(PayloadSizeInBytes) ) );
+    BOOST_ASSERT( left_byte < right_byte );
+    BOOST_ASSERT( ( right_byte - left_byte ) == sizeof(uint16_t) );
+
     Payload[ left_byte ] = static_cast<uint8_t> ( value >> 8 );
     Payload[ right_byte ] = static_cast<uint8_t> ( value & 0xFF );
 }
 }
 
 /**
- * @brief Writes all the data present in the ostream to the payload buffer.
+ * @brief Writes all the data from the ostream to the payload buffer.
  */
 ostream& MessagePayload::write( ostream &os ) const
 {