When checking channel modes its best to do as follows or if channel key is set it can give bad results.
$gettok($chan(%channel).mode,1,32)