Multichannel support

Modifications for (more or less) properly working multichannel compatibility.