Fixed bug in channels_getnext()