Various changes to the channel code