Minor bugfix, correctly writes variable channel number