fix joining channels

by forcing sink context on the for loop.
Otherwise it only works when called in sink context.
Merged moritz's change. Fixed up the bad modelines floating around in my files