ieof-for-nonexistent-channel problem: avoid comparing an unsigned with -1