Fixed crash due to logic error in channelCache

Fixes #288