Rename CHAN to channel
Fix incorrect raise