Fix bug in command channel.read (count overflow)