Fix bug causing mixed up channel information, and set the logical channel number and sort order consistently.