Fix bug where channels were not correctly preserved

Closes #80.