Fixed a bug when there are more than two channels present.