backport fix for using the right number of channels
fixes #49