Fix compiler warning on OpenBSD, fix possible channel joining bug