Fixes for line and channel handling