main: Cleanup.
Support reading or writing from multiple channels.