properly cancel all the pending sessions when the slave unexpectedly goes away
when serializing a typelist, make an array the size of typelist, not the argument pack, so that nested typelists could be used in the future
serialize the event number as a short number
minor stuff