sending, receiving and decoding msgs, minor fixes