fix bugs on multi-channel handling.