Minor bugfixes, better channel serialization on shutdown.