Fixed a bug in channel removal routine