fix logic bugs on link channel handling, tests passing now