Fixed potential bug in publishing from ChannelDefinition
Added tests for ChannelDefinition.publish