channel: fix message parsing of error and terminate messages