const U64 maxValPerChannel = (U64)1 << mBitsPerChannel;

Fixed on #989